How can I make an actor stop & shoot, and increase the health bar?
bigticket21
Member Posts: 4
I'm trying to work on a project where there are different enemies who run around and shoot at you. So the dilemma I'm having is that I can't make them stop and shoot at you. How can you do that?
So far I've tried the following:
I created 3 integers in the actor
Rule - Move, angle 0 (that means it moves right?)
Then when Position X = 50, make int1=random(1,3), make int2=random(150,200), make int3=random(10,40)
Then, if int1 is 1 AND Position X=int2, start moving at angle 180 (left?)
Then again when Position X=int3, restore moving to right.
It doesn't work though. I don't know what I'm doing wrong. So far what I've done has worked.
Also, I have absolutely no idea how to make them stop at one point (let's say around Position X = 400) and start shooting at the player.
Another thing I'm trying to make is a special enemy which follows the player and when it's near him, it's starts shooting.
And one last thing, how can I make a health bar not only decrease over time, but increase at certain points?
So far I've tried the following:
I created 3 integers in the actor
Rule - Move, angle 0 (that means it moves right?)
Then when Position X = 50, make int1=random(1,3), make int2=random(150,200), make int3=random(10,40)
Then, if int1 is 1 AND Position X=int2, start moving at angle 180 (left?)
Then again when Position X=int3, restore moving to right.
It doesn't work though. I don't know what I'm doing wrong. So far what I've done has worked.
Also, I have absolutely no idea how to make them stop at one point (let's say around Position X = 400) and start shooting at the player.
Another thing I'm trying to make is a special enemy which follows the player and when it's near him, it's starts shooting.
And one last thing, how can I make a health bar not only decrease over time, but increase at certain points?
Comments
then rule when X = 50
do what you want.
Not sure what you're trying to do with the ints?
for health bar check this: http://gamesalad.com/wiki/how_tos:gsc_health_bar
Thanks for the tip
Still don't know how to make them start shooting though.