1 decade ago by BennyT
Currently working on a game where there are certain items that can be equiped by either the player entity OR the enemy at any given time. Once either entity owns/equips it, it will only become available again once it has been dropped (either by choice or due to an attack).
What is the best way to execute this:
- Have the player/enemy entity have the collidesWith function check if the collision is with the item entity
- Have the item entity check to see whether or not it is a player or enemy entity and assign that entity as its "owner"
The trouble I am having at the moment is that I can get the player to pick it up no problems using the first concept, but the enemy won't pick it up or even register the collision.
I am also using Impact-Bootstrap by Jesse Freeman if that helps (or anyone has experience with it and this particular problem)
What is the best way to execute this:
- Have the player/enemy entity have the collidesWith function check if the collision is with the item entity
- Have the item entity check to see whether or not it is a player or enemy entity and assign that entity as its "owner"
The trouble I am having at the moment is that I can get the player to pick it up no problems using the first concept, but the enemy won't pick it up or even register the collision.
I am also using Impact-Bootstrap by Jesse Freeman if that helps (or anyone has experience with it and this particular problem)