Question about enemys

Non-platform specific questions.

Question about enemys

Postby bkelynch » Sat Dec 23, 2006 2:24 pm

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. :)
bkelynch
 
Posts: 73
Joined: Sun Dec 04, 2005 7:48 pm
Score: 0 Give a positive score

Postby makslane » Sat Dec 23, 2006 2:35 pm

When the enemy collides with left or right side of the wall, put the code:

Code: Select all
xvelocity = -xvelocity;
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby bkelynch » Sat Dec 23, 2006 2:55 pm

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.
bkelynch
 
Posts: 73
Joined: Sun Dec 04, 2005 7:48 pm
Score: 0 Give a positive score

Postby makslane » Sat Dec 23, 2006 3:09 pm

Can you show the script?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby bkelynch » Sat Dec 23, 2006 4:14 pm

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.
bkelynch
 
Posts: 73
Joined: Sun Dec 04, 2005 7:48 pm
Score: 0 Give a positive score

Postby makslane » Sat Dec 23, 2006 6:01 pm

I have no idea
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Yscop » Tue Feb 20, 2007 12:38 am

did you set the 'final velocity multipyer' to 0? It should be kept 1 otherwise he/she/it/shim would stop.
If god can do anything can he make a rock so big that he can't throw it?

Don't tell anyone, if they knew I was an atheist they would pelt my house rocks!
User avatar
Yscop
 
Posts: 2
Joined: Thu Feb 15, 2007 2:48 am
Location: In your closet
Score: 0 Give a positive score

Postby Sgt. Sparky » Tue Feb 20, 2007 2:37 am

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 :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest