1 Star 0 Fork 0

Mr.Dragon / AngryBots_ECS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

AngryBots ECS

The DOTS project used for the presentation Converting Your Game to DOTS and contains an example of how DOTS could be used to replace a low performance process in your games (shooting many bullets at once, in this case). This is meant to provide a simple, targeted example. A video presentation of this project can be seen here

The basics

This project uses a combination of game objects and entities together. In this case, the player (game objets) spawns bullets (entity). There is an Enemy Spawner (game object) that spawns enemies (entities). When enemies die, they spawn particle effects (game objects).

Collision

Since the bullets and enemies are entities and the player is a game object, making them collide with the built in physics system won't work. As such, collision is handled by a system (CollisionSystem) and is very simplistic in nature. In this system general radius is used to calculate if bullets have collided with enemies or enemies with players. A more sophisticted collision algorithm, or even the new DOTS physics, could have been used, but this is meant to be a simple example and really isn't necessary.

The systems

Several systems are used to replace the monobehaviour functionality of the bullets and enemies

  • MoveForwardSystem - Moves any entity with the MoveForward component forward at some speed
  • TurnTowardsPlayerSystem - Turns enemy entities to face the player's position
  • CollisionSystem - Detects simple radius collision between bullets, enemies, and players
  • RemoveDeadSystem - Destroys any entities that have a Healt of zero or less
  • TimedDestroySystem - Destroys any entities that have run out of time to live (bullets)
  • PlayerTransformUpdateSystem - Due to the hybrid nature of the player game object, this sytem is needed to keep the entities position in sync with the game object's position

空文件

简介

The DOTS project used for the presentation Converting Your Game to DOTS 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/longzjl/AngryBots_ECS.git
git@gitee.com:longzjl/AngryBots_ECS.git
longzjl
AngryBots_ECS
AngryBots_ECS
master

搜索帮助