The Daily Click ::. Forums ::. Klik Coding Help ::. Coding a boss to teleport from one side to another at random times?
 

Post Reply  Post Oekaki 
 

Posted By Message

J.C



Registered
  22/03/2013 05:18:14
Points
  118
22nd March, 2013 at 22/03/2013 05:30:43 -

Hi. I need help on coding the boss fight for my game. What I am trying to do is make the boss teleport from one side on the screen to the other at random times every few seconds for the first stage of the boss fight.

I tried to use Alterable Values to make him teleport when it reaches a certain value, but couldn't get it to work.

Any help would be appreciated.

 
n/a

nim



Registered
  17/05/2002
Points
  7233
22nd March, 2013 at 22/03/2013 06:21:48 -

Always
-Subtract 1 from Counter

Counter < 0
-Set X coordinate to random(640)
-Set Counter to 50


Make the counter visible on the frame so that you can see what's going on if you need to.

 
//

nivram



Registered
  20/07/2006
Points
  171
22nd March, 2013 at 22/03/2013 13:38:09 -


Originally Posted by nim
Always
-Subtract 1 from Counter

Counter < 0
-Set X coordinate to random(640)
-Set Counter to 50


Make the counter visible on the frame so that you can see what's going on if you need to.



For random times maybe set the counter to:
-Set Counter to random(50)

This is less than one second, so it would probably make since to increase the counter time.

Marv

Edited by nivram

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
22nd March, 2013 at 22/03/2013 15:27:43 -

Going with nim's example, I'd change the Always event to

ALWAYS Subtract Random(5) from Counter

...But otherwise that looks like a fine example to me.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click