edimier / laya_bomb Goto Github PK
View Code? Open in Web Editor NEW一个基于laya的简易炸弹人H5游戏,包括了websocket网络层封装、proto协议封装、http封装,可以当作一个多人在线游戏的demo继续做深入的开发。
一个基于laya的简易炸弹人H5游戏,包括了websocket网络层封装、proto协议封装、http封装,可以当作一个多人在线游戏的demo继续做深入的开发。
if(module == "user"){
protoBuilderMap = this._protoBuilderUserMap;
} else {
protoBuilderMap = this._protoBuilderGameMap;
}
protoBuilderMap.then( (root)=>{
let AwesomeMessage = root.lookup(name);
if(AwesomeMessage){
if(Define.DEBUG_NET){
console.log("Find name : " + name + ", id = " + nameId + ", module:" + module + ",action:" + action);
}
let decodeData = AwesomeMessage.decode( bytes.getUint8Array(4, bytes.length - 4));
this.event(name, decodeData);
} else {
console.log("Can not find name : " + name + ", id = " + nameId + ", module:" + module + ",action:" + action);
}
})
//
this.event(name, decodeData);这个是解码事件,但是别的玩家的一些移动、放炸弹事件等,在这里函数里面怎么解码的呢?后来看了下,在GameMain里面实现了,这是事件的冒泡机制吗?
另外有没有服务器的代码可以参考下 谢谢了
服务端代码可以开源下吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.