Page 1 of 1

Question about enemys

PostPosted: Sat Dec 23, 2006 2:24 pm
by bkelynch
I want to make an enemy in my game that doesnt move in a path back and forth, because I want to make one which actually has gravity like my player actor, and has a physical response against the platform actor. It also moves in an xvelocity one way, and switches to the opposite direction when it hits a wall, sort of like those enemies u see in the old mario games. :)

PostPosted: Sat Dec 23, 2006 2:35 pm
by makslane
When the enemy collides with left or right side of the wall, put the code:

Code: Select all
xvelocity = -xvelocity;

PostPosted: Sat Dec 23, 2006 2:55 pm
by bkelynch
ok, ive created my enemy actor, and added the PR, gravity, and xvelocity, but when i start the game, the enemy just stands there, and doesnt follow the script code for my xvelocity direction.

PostPosted: Sat Dec 23, 2006 3:09 pm
by makslane
Can you show the script?

PostPosted: Sat Dec 23, 2006 4:14 pm
by bkelynch
It isnt much, I just used the event create actor, and typed in:

xvelocity = -4;

immediate action


I have no idea why it doesnt work during gameplay.

PostPosted: Sat Dec 23, 2006 6:01 pm
by makslane
I have no idea

PostPosted: Tue Feb 20, 2007 12:38 am
by Yscop
did you set the 'final velocity multipyer' to 0? It should be kept 1 otherwise he/she/it/shim would stop.

PostPosted: Tue Feb 20, 2007 2:37 am
by Sgt. Sparky
use an Actor Var called Go.
Code: Select all
if(Go == 1)xvelocity = 5;
if(Go == 0)Xvelocity = -3;

you can play around with that :)