1

Hi guys!
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!

Thumbs up

2 (edited by brian.kurosawa 2017-11-04 18: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.

Thumbs up

3

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

Thumbs up

4

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.

Thumbs up

5

If the enemy is created in one object. If not an array. How to delete?

Thumbs up

6

Set the pointer to null, for example: Enemy handle; @handle=null;

Thumbs up