1 decade ago by Attanar
I have made some maps with entities (kind of coins) that disappear once the player takes them.
The thing is, if the player dies, I want to restart the level and bring those entities back to where they were.
If I use entity.kill() to remove the entities when the player picks them, then I can't find a way to spawn them back into their original position. I am sure this must be a common mechanic to many games, but I can't find any explanation on how to do this, or any property in the Entity docs that matches what I want to do.
Is there anything like a boolean "exists", that can be set to true or false, so that the entity wont be drawn or checked for collisions in case it is false?
Thanks :)
The thing is, if the player dies, I want to restart the level and bring those entities back to where they were.
If I use entity.kill() to remove the entities when the player picks them, then I can't find a way to spawn them back into their original position. I am sure this must be a common mechanic to many games, but I can't find any explanation on how to do this, or any property in the Entity docs that matches what I want to do.
Is there anything like a boolean "exists", that can be set to true or false, so that the entity wont be drawn or checked for collisions in case it is false?
Thanks :)