Commit Graph

21 Commits

Author SHA1 Message Date
83223e5dc2 Move Entity management to new EntityManager class to clean up Engine 2020-01-27 01:35:51 +04:00
82828ff05d Add has() method to ComponentMapper
Some other minor changes:
* Made ComponentType final + package-private
* Made Entity and ComponentType id protected to allow direct access from
  Engine
* Made ComponentType bits protected to allow direct access from Entity
* Made Entity componentBIts protected to allow direct access from
  ComponentMapper and EntitySystem
2020-01-26 16:00:06 +04:00
bd37d4fc65 Reuse removed entities - prevents massive entity component arrays.
Assign each entity a uniqueId as well as their regular ID. The uniqueID
of an entity is always difference from past or present active entities.
2020-01-26 12:48:27 +04:00
5d9d49971f Add BaseSystem which all systems (entity processing or not) extend from 2020-01-26 04:11:48 +04:00
28dbff3d16 Delete bullets when they leave the screen 2020-01-25 17:55:23 +04:00
b9148c028d Add CollisionSystem 2020-01-25 17:26:44 +04:00
74ba61ee53 Add EntityFactory, player can now shoot bullets
Add DEBUG Constant + rendering of FPS when true
2020-01-25 17:26:04 +04:00
087b53564f maxVelocity = Float.MAX_VALUE by default 2020-01-25 17:21:14 +04:00
5eed818cc3 It makes more sense for Component to be an interface 2020-01-25 15:51:06 +04:00
f44f34b3de Add ComponentMapper for faster retrieval of entity components 2020-01-25 15:34:58 +04:00
d97c956607 Cleanup of ListenerRegistry 2020-01-25 14:03:50 +04:00
90e5ff36e7 Move entity processing loop to systems
Store cache of interested entities in each system.

Perform entity activation, deactivation and removal outside of the update
loop.

Instead of throwing an exception when trying to get a Component from
ComponentBag that is out of range, just return null. This is to allow
systems to try getting a Component it isn't registered for.

Fixed ComponentType.isTypeInMask
2020-01-25 13:56:35 +04:00
d8b82c4fee Fix screen wrapping math
Rather than place entities directly on the screen edge boundary, add the
distance they were beyond the screen edge.

Store aabb in ModelComponent for use by multiple systems.
2020-01-25 13:18:38 +04:00
22fc504619 Add Event/Listener framework to common/ecs 2020-01-25 00:18:16 +04:00
83113f3afd Rotate at a frame time dependent rate (300 degrees / second) 2020-01-25 00:18:16 +04:00
3d9b62d455 Add screen wrapping system
Move model position/rotation updating to movement system
2020-01-25 00:17:14 +04:00
d7c55d72e3 Set up ECS on GameScreen: register components and systems, add player 2020-01-24 17:24:08 +04:00
6fb664adaf Add player/model components + input/render systems 2020-01-24 16:05:13 +04:00
e38b538a1e Add movement/acceleration/velocity components + movement system 2020-01-24 16:05:13 +04:00
89a7bc031c Add beginnings of game code. 2020-01-24 16:05:08 +04:00
909b50b47d Add base project files. 2020-01-24 12:03:04 +04:00