genius-x

An Entity Component System framework based on Cocos2d-x

  • 所有者: Genius-x/genius-x
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Genius-x

Genius-x是一个基于以属性为中心的游戏对象模型构建的游戏框架,它基于Cocos2d-x,目前支持使用C++/Lua两种语言进行开发,Genius-x最大的目标是要实现数据驱动,使程序中关于关卡设计的部分可以最大限度地从程序中抽离出来,让设计和程序以及其他相关人员进行更轻易地协同开发。

特别致谢

Genius-x最早于2014年在北京魂世界(SoulGame)的手游项目中使用,并在其授权下将其开源,在此非常感谢魂世界对此项目的支持。

参考资料

  1. 《游戏引擎架构》
  2. 《我所理解的Cocos2d-x》
  3. 《游戏编程精粹(第6卷第4章)》
  4. 《A Data-Driven Game Object System》

怎样使用?

  1. 将根目录的genius-x目录拷贝至你的游戏目录中同cocos2d同级的目录,因为Genius-x会引用Cocos2d-x工程。
  2. 将genius-x/build目录下对应平台的工程文件添加引用至你的项目中。
  3. 添加搜索路径,这样才能找到头文件引用,例如在XCode中设置为$(SRCROOT)/../genius-x/genius。
  4. 添加静态库链接。

特性

  1. based on the Origin Entity Component System idea(Decoupbe the system from component,this make it diff from Component-based design).
  2. automatic attching system to Entity,you only need concern component.So,
  3. it's data-driven.
  4. better performance,we make every Entity has it's own System instance,but still keep auto-attaching,you do not need care about System.
  5. lua and javascript binding support.(progress....)
  6. system ordered.

How to use?

  1. create an Entity: ECSmanager::createEntity();
  2. create you own Component which should be a subclass of ECS::Component , such as 'MyComponent'
  3. create you System which should be a subclass of ECS::System
  4. init the ECSManager: auto ecs=new ECSManager();
  5. put all your system: ecs->addSystem(mySystem);
  6. add component to Entity: ecs->addComponentToEntity(myComponent,myEntity);
  7. call the update methed of ECSManager in your gameloop, such as the visit or update method of HelloWorldScene.
  8. that's it!

讨论

you may leave a message at my blog: http://genius-x.org

Please enjoy this.

主要指标

概览
名称与所有者Genius-x/genius-x
主编程语言C++
编程语言C++ (语言数: 11)
平台
许可证
所有者活动
创建于2014-07-07 04:44:55
推送于2014-12-26 10:44:24
最后一次提交2014-07-18 11:41:35
发布数0
用户参与
星数166
关注者数41
派生数69
提交数35
已启用问题?
问题数17
打开的问题数14
拉请求数2
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?