The Daily Click ::. Forums ::. Klik Coding Help ::. Platform enemy
 

Post Reply  Post Oekaki 
 

Posted By Message

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
9th September, 2007 at 09:07:32 -

I have simple problem. I like to make platform enemies. They would walk and change their direction when collides walls and also they should fall when there is no floor below them.

Here is some kind of art of it:
http://img512.imageshack.us/my.php?image=platformaq0.jpg

So simple, but I don't find out the way how to make it

Image Edited by the Author.

 
n/a

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
9th September, 2007 at 09:25:42 -

Right, this can be done in a few events, but you have to pay attention.

First of all, make him walk in the direction he's facing. If he's facing left, subtract 1 from his x coordinate or the opposite for right. Only do this if flag 0 = off.

Then, if he collides with a backdrop, set his direction to +16 to make him flip around.

Next we need to check if he has wandered over a hole. So "always" put his y coordinate +1 and flag 0= = on, check for a collision in the next event, if it is positive, put his y coordinate to -1 to make him pop back up again and put flag 0 = off to make him keep walking. This all happens before MMF draws the screen, so it should be fine.

Here as a quick example you can modify.

http://www.nicandreb.f2s.com/downloads/walkexample.mfa

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
9th September, 2007 at 09:28:19 -

That should help me. Thank you

 
n/a

-Nick-

Possibly Insane

Registered
  24/11/2002
Points
  2468

VIP Member
9th September, 2007 at 09:51:13 -

You're welcome. If you need any help making it any "nicer" just ask, as that is just the bare bones.

 
Project: Roller Coaster is on it's way!
http://www.projectrollercoaster.co.uk/
http://www.craftsncreatures.com

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
9th September, 2007 at 13:35:16 -

It's not always that simple though. Believe me.

Well it's much simpler if you don't put all the enemies that move like that into the same group anyway.

 
.

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
12th September, 2007 at 18:39:29 -

Also you can always make detectors and place them on the walls where they collide, using 'collides with backdrop' can be a bit freakish, especially with your level and what you're doing, as they will change direction upon falling on to a new backdrop so will not touch the walls before turning.

 
http://www.SilverNova.co.uk


AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
12th September, 2007 at 19:56:30 -


Originally Posted by SilverNova / Tim
Also you can always make detectors and place them on the walls where they collide, using 'collides with backdrop' can be a bit freakish, especially with your level and what you're doing, as they will change direction upon falling on to a new backdrop so will not touch the walls before turning.



Yeah, it is possible to get around that turning on touching the floor. Also you don't need detectors on walls either.

 
.
   

Post Reply



 



Advertisement

Worth A Click