The Daily Click ::. Forums ::. Klik Coding Help ::. Top Down Enemy Movement
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
25th July, 2008 at 21:03:03 -

I am having a problem with my enemy movement system. I am trying to get the enemy to collide with the wall and then go the opposite direction. Currently it only works with two of the 4 directions. I know that the order of the events have something to do with it because once I change the order the directions that work change also. I need them all to work. If anyone could help me out it would be most excellent.

-original-
1- does not work
2- works
3- does not work
4- works

-changed-
2- does not work
1- works
4- does not work
3- works


Here is the link to the file. Please take a look at it.
http://www.megaupload.com/?d=3N0QHIJT




 
Hello guys! I'm New! -- I've been new for a year now...haha

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th July, 2008 at 00:02:23 -

if its 4 direction movement the simplest way to do it is in a single event (also good with all directions if you want it to go in the opposite direction on collision)

-on collision with wall
+set dir to dir_of_enemey - 16

ill download your thing and see whats up though.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th July, 2008 at 00:19:58 -

oh youre not usuing "actual" directions. the entire enemy movement is custom. hmm

problem solved http://legendkpr.startlogic.com/files/theswordmfa.zip

i added a condition to your enemy collision loops. alterable value z must = 0 and then set the value to something else on collision. then when not colliding set it back to 0. you should change it to a flag.

Image Edited by the Author.

 
n/a

Logiq



Registered
  09/04/2007
Points
  120
26th July, 2008 at 21:00:52 -

I wanted to say thanks... everything is working fine now.

 
Hello guys! I'm New! -- I've been new for a year now...haha
   

Post Reply



 



Advertisement

Worth A Click