The Daily Click ::. Forums ::. Klik Coding Help ::. Programming Enemy Movement
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  531

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
1st August, 2012 at 01/08/2012 18:04:19 -

I'm wondering what kind of methods are most commonly used in platform games (such as the Super Mario games) for programming enemy movement patterns. I've heard of people using a secondary Platform Movement Object for more advanced enemy movements, but I just wanted to get some ideas of what most people use in MMF2 when dealing with enemies. I don't really need examples, just a quick explanation of what you do would be great. (I just want to make sure using mostly the Path Movement isn't a very bad idea, really )

Thanks for any input!

Edited by -Liam-

 
Image

Tell 'em Babs is 'ere...

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14456

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
2nd August, 2012 at 02/08/2012 01:45:52 -

I use internal detectors and lots of unrolled loops because i'm too stupid to work out how to make fastloops work with multiple instances of the same object.
But hey it works. You can see from this example. (37 seconds onwards).



 
.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
2nd August, 2012 at 02/08/2012 12:49:41 -

It depends on the complexity of what you you're trying to achieve.

I wouldn't use the path movement, because it doesn't give you enough flexibility.
However, if you don't need enemies to respond to gravity, you could just use the built-in bouncing ball movement (limit it to left/right), and have the enemy bounce when it hits a wall or an invisible marker positioned at each end of the platform.

If you need something more complex (esp. if the scenery is not fixed), then I'd do what AndyUK suggests. I always use a custom movement (not the PMO) with embedded collision detectors.
eg. http://skydrive.live.com/redir?resid=B1E7EE094271BBDA!515


 
n/a

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2722
5th August, 2012 at 05/08/2012 11:14:02 -

I agree with Sketchy, a custom movement allows for much more flexibility in your games. Like jumping and falling for your enemies.

But of course if an enemy just needs to walk along a horizontal line, then he would just get some code from me that makes him move left or right (could be bouncing ball, could be xpos=xpos+2 or xpos=xpos-2) and some boundaries, which are invisible or made up of the level elements itself.

 
Image jenswa.neocities.org

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  531

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
5th August, 2012 at 05/08/2012 14:39:07 -

Thanks guys, I appreciate the input. And your vid Andy. I'm glad we can get away with paths or bouncing ball movements for simple stuff though, too.

 
Image

Tell 'em Babs is 'ere...
   

Post Reply



 



Advertisement

Worth A Click