I have a question.
For example, I have an enemy class in BGT.
But how to make the removal of the enemy?
The question arises 2:
1. What should I write in the distructure?
2. How to cause the distructure.
Please show examples.
Thanks in advance!
#2 (edited by brian.kurosawa 2017-11-04 19:05:59)
If you use a looping sound on the sound pool, keep it on a int variable so when you call the destructor you destroy that sound as well. For destroying enemies you may create an array with the enemies on the map and remove it when he's dead.
does remove_at remove the enemy? And if the enemy is one, just for example. And when the destructor is started. How to destroy an object
Remove_at will remove the handle referencing that enemy on the array. If there's no handles referencing it, the destructor is called and the object destroyed.
If the enemy is created in one object. If not an array. How to delete?
Set the pointer to null, for example: Enemy handle; @handle=null;