Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entity-collisions/registrations to CollisionGrid #4

Closed
sivertsenstian opened this issue Jan 27, 2015 · 0 comments
Closed

Add entity-collisions/registrations to CollisionGrid #4

sivertsenstian opened this issue Jan 27, 2015 · 0 comments
Assignees

Comments

@sivertsenstian
Copy link
Owner

The Collision grid should have support for detecting collisions with non-static entities.

Right now it only registers static entities in the collisiongrid.
Should probably have an additionl grid-layout with non-static entities that are specified by entity-id to generate different results based on the entities colliding.

E.g. if a bullet collides with an enemy in the new grid - this should trigger a -health on the given entity and whatever follows from that (death, hurt etc..)

Should probably rename the current grid-array in collisiongrid to reflect this

  • Not sure if best to combine the two grids, or have separate (might be easier with separate so I might start with this)
@sivertsenstian sivertsenstian self-assigned this Jan 27, 2015
sivertsenstian pushed a commit that referenced this issue Feb 1, 2015
Entities now all belong to a faction FRIENDLY or HOSTILE (default
HOSTILE).
Collisions between entities with same faction is ignored for now
(logged).

Results in:
Monsters can now be hit by e.g. a player weapon and be disposed - but
player can not attack himself. Next step is to implement health and
more advanced hit-triggers (take damage etc.. HIT its own category?).

This is the first iteration of this and I think it can be improved - but
for now it works! Height is not considered (but should be checked y pos
vs entity-height if it is actually a hit!)

Entities are now placed on the tiled-map and spawend in the correct
position like anything else! Need to also add the entities from the map
instead of having to be manually defined as legal entities for the
factory to be able to spawn them.

Entity factory returns a new entity based on the type and params given
(defined in constants and from the map (e.g. position)

Fixes #3 #4 #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant