【Starter Kit】Cocos2d-x《猫狗大战》卡牌客户端+服务器源码开源放送!
Cocos2d-x版本基于:Cocos2d-x 2.1.5语言:JS(JSB)作者:u0u0(刘克男),一叶(刘雪锋),Iven(杨雍)Github开源地址:https://github.com/iTyran/SK_CardGame(或点击最下方“阅读原文”)目录结构客户端工程目录projects/CardGame测试包下载见Github中 readme.md服务器下载属性语言:Golang网络.
·
Cocos2d-x版本
基于:Cocos2d-x 2.1.5
语言:JS(JSB)
作者:u0u0(刘克男),一叶(刘雪锋),Iven(杨雍)
Github开源地址:https://github.com/iTyran/SK_CardGame (或点击最下方“阅读原文”)
目录结构
客户端工程目录
projects/CardGame
测试包下载
见Github中 readme.md
服务器下载
属性
语言:Golang
网络:websocket
作者:u0u0(刘克男)
接口示例
Login module
Register
{
"Command" : "CM_REGISTER",
"Param":
{
"Username" : "xxx",
"Password" : "aa",
"Email" : "a@x.com"
}
}
{
"Command" : "CM_REGISTER",
"Return" :
{
"Code" : 0,
"Message" : "CreateCharacter"
}
}
Login
{
"Command" : "CM_LOGIN",
"Param" :
{
"Username" : "xxx",
"Password" : "aa"
}
}
{
"Command" : "CM_LOGIN",
"Return" :
{
"Code" : 0,
"Message" : "Success" // or "CreateCharacter"
}
}
Create character (LOGIN FIRST)
{
"Command" : "CM_CHAR_CREATE",
"Param" :
{
"CharName" : "xxx",
}
}
{
"Command" : "CM_CHAR_CREATE",
"Return" :
{
"Code" : 0,
"Message" : {json of char info}
}
}
Get character (LOGIN FIRST)
{
"Command" : "CM_CHAR_GET",
"Param" : ""
}
{
"Command" : "CM_CHAR_GET",
"Return" :
{
"Code" : 0,
"Message" : {json of char info}
}
}
json of char info
{
"CharName": "a New Name ",
"Level" : 1,
"Vitality": 60,
"Scene": 1,
"Stage" : 1
}
Get card array
{
"Command" : "CM_CARDS_GET",
"Param" : ""
}
{
"Command" : "CM_CARDS_GET",
"Return" :
{
"Code" : 0,
"Message" : {json of card array}
}
}
json of card array
[
{
"Name": "小花猫",
"HP": 21,
"Attack": 27,
"Defence": 13,
"Speed": 120,
"Talent": 720,
"Drop": 50,
"Experience": 324,
"Skill": [1,2],
"ID": "002",
"Level": 1,
"Status": 1,
"Hash": "0xc2000e9630",
}
]
Raid
{
"Command" : "CM_RAID",
"Param" : {
"Scene" : 1,
"Stage" : 1
}
}
{
"Command" : "CM_RAID",
"Return" :
{
"Code" : 0,
"Message" : "{battle command order}"
}
}
Github开源地址:https://github.com/iTyran/SK_CardGame (或点击最下方“阅读原文”)
关注 “COCOS” 公众号,获取最新引擎信息!
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献21条内容
所有评论(0)