本指南将指导您使用 web APIs 将您的 Construct 游戏与 Basement.fun 平台集成。
AJAX.LastData
引用创建函数
设置服务方法头
X-Service-Method
setUserScore
设置授权头
Authorization
Bearer <game secret>
<game secret>
替换为您实际的游戏密钥令牌。配置 POST 请求
setUserScore
https://api.basement.fun/launcher
{"launcherJwt": "string", "nonce": "string", "score": 0}
POST
创建全局变量
添加触发事件
调用 SetScore 函数
解析 JSON 响应
AJAX.LastData
。提取 Nonce 值
JSON.Get("newScore.nonce")
。设置用户分数
POST /launcher
X-Service-Method: setUserScore
获取用户分数
GET /launcher
X-Service-Method: getUserScore
触发规则引擎
POST /launcher
X-Service-Method: triggerRulesEngine
success
字段,并优雅地处理错误。AJAX 请求不工作
JSON 解析错误
AJAX.LastData
是否包含有效的 JSON认证问题