gamemaker如何实现注册登录功能
教大家一个方法用gamemaker实现注册登录功能
操作方法
- 01
制作注册键精灵
- 02
制作登录键精灵
- 03
创建一个注册物体,左键事件写上 username = get_string("New username:","")if (registry_exists(username)) {show_message("That username is already taken")}else {password = get_string("New Password:","")registry_write_string(username,password)} (gamemaker不支持中文,最好不使用中文)
- 04
创建一个登录物体,左键事件写上 username = get_string("Username:","")password = get_string("Password:","")if (registry_exists(username)) {rpassword = registry_read_string(username)}else {show_message("That username does not exist")exit;}if (rpassword == password) {show_message("Both username and password is correct")}
- 05
在房间里放上注册物体和登录物体
- 06
运行游戏,就可以注册登录
赞 (0)