Rename createPlayerDebris -> createDebris to make it clear it's not only
for the player entity.
Add Constants.ASTEROID_SPAWN_COUNT
Slow down asteroids, tweak sizing
Reduced explosion direction variation and max angular velocity so it's
more apparent that the lines were from the original ship.
Removed subtraction then adding back of player position from getLineModels
Formatting + comments.
When rotation was < 0, we were subtracting it from 360, which was
producing a number larger than 360. We should have been adding it to 360,
not subtracting.
Moved angle wrapping math to a separate function.
* Add AsteroidSpawningSystem which adds asteroids to the game at a regular
interval up to a set limit.
* Add EventFactory for generating entity-specific Collision events
* Detect asteroids being shot with BulletAsteroidCollisionEvent
* Add DEBUG output to creating entities
* New getPointAlongPolygon utils function
Consolidate toRemove, toEnable toDisable into toRefresh, move logic of
whether an entity should be added or removed to an EntitySystem into
EntitySystem.
Entities now have a systemBits member which represents which
systems they're currently a part of and is used by the refresh() logic
in EntitySystem.
Adding or removing components from an entity after it has been created
and activated will now add or remote the entity from relevant systems.
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
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
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.