客户端属性
基于:Cocos2d-x 2.1.5
语言:JS(JSB)
视频地址:http://v.youku.com/v_show/id_XNjE1NDI3NzI4.html
目录结构
客户端工程目录
projects/CardGame
测试包下载
见Github中 readme.md
服务器
https://github.com/iTyran/SK_CardGame#属性
语言:Golang
网络:websocket
接口示例
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”: , “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}” }}
源码地址:https://github.com/iTyran/SK_CardGame
ps. 由于一些原因,目前只做到demo级别,有兴趣的朋友欢迎贡献代码!!