The Daily Click ::. Forums ::. Klik Coding Help ::. Enemy walking on a platform problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd February, 2010 at 13:13:02 -

Hello guys!

As you may or may not know, I'm pretty bad at fastloops however I've been getting better recently. My latest problem has to do with an enemy's movement. Very simply, I want them to walk back and forth on different platforms and once they get to the end of it they turn around and go the other way.

But first, an illustration!

Image

I've set up detectors that are set to the bottom LH and RH of each enemy and this part works because I can see them. My idea is if the LH detector isn't overlapping a backdrop then the enemy's MOVEDIR value is set 2 and he walks to the right. If the RH detector isn't overlapping a backdrop then the enemy's MOVEDIR is set to 1 and he walks to the left. But for whatever reason all that happens is my enemies walk along the platform and fall off, down and off the screen. NEVER TO RETURN!

I have spread values working always for each enemy object and for the detectors. I have the check set up sorta' like this:

Always -> Spread value 0 in val Z for Group.Enemy
Always -> Spread value 0 in val Z for LH detector

Always Start Loop "ENEMYWALK" (# of group.enemy objects times)

On Loop "ENEMYWALK"
+Group.Enemy Val "Z" = LoopIndex("ENEMYWALK")
+LH detector Val "Z" = LoopIndex("ENEMYWALK")
+LH detector is overlapping a backdrop (NEGATED)
+Group.Enemy is overlapping a backdrop
+Group.Enemy Val (MOVEDIR) = 1
-> Set Group.Enemy Val (MOVEDIR) to 2 -> Change Direction to Right


And then I do the same thing for MOVEDIR 2 and the RH detector which should move him left. What the heck am I doing wrong?

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
23rd February, 2010 at 15:35:24 -

Would you mind posting the source?

Also, why would you use a method that requires every enemy to have sensors?

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
23rd February, 2010 at 18:36:53 -

I can't post the source because it's about 60MB and all top-secrety.

I'm using detectors for every enemy because they'll all be moving around differently from each other and all be subject to different platforms and possible objects in their paths and everything. Isn't what you're supposed to do?

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

aphant



Registered
  18/05/2008
Points
  1242
23rd February, 2010 at 19:16:25 -

Why not switch to static detectors? Put a "Turn around" detector on the ends of the platform. Set it so that only enemies that follow this behavior are affected by it.

 

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
23rd February, 2010 at 19:17:49 -

Embedded collision detectors are awesome - use them and you won't have to bother with spread values, fastloops, etc any more.
http://www.create-games.com/article.asp?id=1639

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
24th February, 2010 at 13:41:14 -


Originally Posted by aphant
Why not switch to static detectors? Put a "Turn around" detector on the ends of the platform. Set it so that only enemies that follow this behavior are affected by it.



This is what I ended up doing. I've used them in the past but I originally wanted a bit more diversity with the bad guys. So say maybe if he was pushed off a ledge he'd fall and be able to safety move around on the platform or whatever below him.

Any port in a storm, and it works now. Thanks guys!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click