Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by hallsofvallhalla

I have it where players can place entities. I want the entities animation, or image to be based on what entities are around them. So say for instance I am building a wall. I have all entities fall in a 32x32 grid. If i go to place a block i want to check if any of the squares around it have that entity block.

Anyone have any ideas on how to detect if block exits ontop, to the left, right, and below, or all of the above?

1 decade ago by hallsofvallhalla

okay i have it where I create a new entity upon block placement and move that entity to the 32x32 section above the currently placed block. I then do a check for collision, if so remove health. So if health = 10 then no collision

It works but the collision is slower than the original functions call to check for the collision when it is spawned.

So example
Spawn entity
Check health of spawned entity

it spawns the entity but the checks for the health before the collision code inside the entity is checked.
Page 1 of 1
« first « previous next › last »