Managing the ennemies

Hello I’m doing a 8 direction game and I am trying to make my ennemies work well.
I’m a beginner on that software.
Here is a few points where I have trouble.

1 - Life : I created a variable for life which is affected when the ennemy is touched, but the thing is that I don’t want to have to create a variable for each ennemy in the events because I’ll have to create a lot ! I tried to modify the variable in the enemy properties. I created an EnemyLife variable with 100 with an initial value of 100, but then when I start the game the value displayed in the text is 0 (I used a string to display the value in a text). How do I make that each of my ennemies have their own variable and only this variable will decrease when I shoot at that specific enemy ?

2 - Movement : I want the ennemy to walk toward the player and keep on following the player even when he reaches it. I did : [Move Enemy to Player with a force of 1 pixels] but then the ennemies walk to my player, pass by and go further before coming back to him.

3 - In this game ennemies can be affected by status effect like burn, freez… I managed to make thoses 2 last effects work but I’m trying to create a really specific one which I have no idea how to create. It’s the “Weak” status.
When the enemy is affected by this status, any damage done to him will be doubled.
I have no idea how to do that.

If someone have any suggestions I’ll be happy !

Thank you !

  1. Right click on the sprite object of your enemy and add a variable health to it, and give it a default value (100 in your case). Each enemy sprite will then start with 100 health.

The object bullet is in collision with enemy

Do -bullet.Variable(damage) to Variable health of enemy.
Delete object bullet [/code]

To view the variable, do something like this:

The cursor is on enemy

Do = enemy.VariableString(health) to the text of text of mytextobject[/code]

Obviously, you will need a text object somewhere on screen also.

3: If an enemy can have the condition ‘weak’, on all events in which enemies are damaged, do this.

The object bullet is in collision with enemy

Do =bullet.Variable(damage) to Variable(lastbulletdamage)
Do -bullet.Variable(damage) to Variable(health) of enemy.
Delete object bullet

If Variable(weak) of enemy = 1

Do -Variable(lastbulletdamange) to health of enemy. [/code]

Thank you I’m gonna try this and let you know !