The Daily Click ::. Forums ::. Klik Coding Help ::. Platform Enemy Behavior....
 

Post Reply  Post Oekaki 
 

Posted By Message

Boo Reeves



Registered
  25/10/2009
Points
  2
4th December, 2009 at 01:50:42 -

I'm fairly new to multimedia fusion 2, however I seem to have picked up some of the basics of the platform movement object, at least enough so that I can make a simple movement engine with a few other variables included.


I was wondering how I can make it so that when my player gets within a certain X distance of my enemy, the enemy stops, faces the player, and throws an object either to the left or right, depending on which direction the player is coming from. I managed to get a somewhat functional system using a large detector that follows the enemy, but was wondering if there was any other way to solve this?



Thanks a ton.

 
n/a

Edron



Registered
  16/09/2008
Points
  0

I am an April Fool
4th December, 2009 at 04:04:12 -

·pos x of player < pos x of enemy + 100
+pos x of player > pox x of enemy - 100
+pos y of player < pos y of enemy + 100
+pos y of player > pos y of enemy -100

= stop enemy, set flag 1 of enemy on

·Flag 1 of enemy on

= ·look at player (0,0), launch object at player (0,0)
·turn flag 1 off

-------

you can change the 100's for the range you want (right now its a 200x200 square). also, if you want the enemy to pause a bit before throwing the object (which could have a ball movement), when flag 1 is on add 1 to value A, and when value A equals 30 (for example), make the enemy throw the object and set the flag 1 off and value A to 0.

Edited by Edron

 
n/a

Boo Reeves



Registered
  25/10/2009
Points
  2
4th December, 2009 at 22:19:28 -

Maybe I'm doing something wrong, but that code doesn't seem to have any effect on it.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click