I'm almost done making a 2D game (and yes I'm sorta a newb) and I still haven't figured out how to delete an entity. Instead, as a place holder, I set the texture path to "" and all the variables to 0. I am using a class and here is basically what the code looks like. I don't know if the formatting is completely wrong or what. Please help
class src_entity_vars
{
public:
//some variables and functions here
void kill();
};
void src_entity_vars::kill()
{
// set all values to 0 and sprite path to ""
}
EDIT: Here's some more if I didn't make myself clear
void main()
{
src_entity_vars enemy; // <- this is what I need to delete
if (enemy.health <= 0)
{
enemy.kill;
}
}