The Daily Click ::. Forums ::. Klik Coding Help ::. A few questions...
 

Post Reply  Post Oekaki 
 

Posted By Message

JetpackLover



Registered
  01/03/2007
Points
  212
15th January, 2009 at 12:33:18 -

First question, I'm trying to do that cool time stop feature that Super Smash Bros Brawl has in it. When you hit someone with a super strong attack in brawl like (Zelda's foward aerial move) time stops for a second and then starts back up again after which the players return to how they were, and the player that got hit gets launched away. It is a bit hard to explain but I hope someone understands me.

My next question is, Let's say I wanted to make something happen every 10 pixels in my game but I don't want to have 100s of lines of code saying 10,20,30 etc. What is the expression that I need to use in order to do this with one line of code? I'm sure it is something simple but I can't figure it out...

My last question is what is the best way of counting in MMF. I don't like using "every" when I code since I know that it only goes by the windows clock and isn't dependent on frame rate. I've been using alterable values that count down from numbers, and recently I discovered the TimeX object and I use Every nth loop for counting now. To summarize this, what is the best way for counting?

Sorry I asked so many questions...

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


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!
15th January, 2009 at 13:19:28 -

I believe the effect you're looking for is called "bullet time" (so searching for that might help). To start with, you need to use custom movements for everything. Then, in every movement related action, you multiply speed by a kind of slowdown factor, shared by all moving objects.

eg, for normal 360 degree movement;

always:
X_bullet = X_bullet + (Cos(Angle_bullet) * Speed_bullet * Slowdown)
Y_bullet = Y_bullet - (Sin(Angle_bullet) * Speed_bullet * Slowdown)

The lower the value of "slowdown", the slower everything happens.
You also need to change animation speeds aswell of course.

The second question didn't make any of sense to me. "Make something happen every 10 pixels" is vague. It may well involve "mod 10 = 0" somewhere along the line, but who knows...

For your third question, I will quote an article by Tigerworks;

All you do is always add 1 to a counter. Now your replacement for an every event is, using Compare 2 general values:
Counter mod 50 = 0
Mod is the remainder of division, e.g. 10 mod 3 = 1 (10 divided by 3 is 3 remainder 1). So the counter holds number of frames so far, and mod 50 makes this a value between 0 and 49. When the counter equals 0, you have reached a new multiple of 50, which means 50 frames have gone by, and the event runs. Remember MMF tries to run your app at 50 frames per second, so Counter mod 50 = 0 would be the equivalent to "Every 1 second". The crucial thing is that it slows down WITH your application.

 
n/a

JetpackLover



Registered
  01/03/2007
Points
  212
15th January, 2009 at 13:30:34 -

I figured I was being too vague. I suck at english please forgive me.

For the first question, I don't want something as complicated as bullet time, I just want to stop all movable objects for a second, and then resume it after that time is up. Just something really quick.

For the second question. What I meant was every 10 pixels on the frame. So like if the player moves 10 pixels then animation will play, and then from that 10 pixels he moves another 10 pixels animation plays again. What I don't want to do is have 100s of lines of code that say for example "Player position = 10x>play animation" "player position = 20x>play animation" I want it to multiply by 10 I guess but I wasn't sure of how to make it work. I tried using "xleft frame *10>play animation" but that didn't work, and if it did work I wouldn't know how to make it work in the reverse, going from right to left. I'm probably over complicating things way too much. So for that I apologize.

Also thanks for the quick reply Sketchy I appreciate it.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


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!
15th January, 2009 at 14:24:14 -

I guess the easy way would be to put all the events you want to pause, into the same group, and then just deactivate it.

If you want to pause *all* ingame events for a second you could just say;

always
* set frame rate to 50

on strong attack
* set framerate to 1


With the "moving 10 pixels" problem, you could try always adding the player's speed to a counter. Then, if the counter is greater than or equal to 10, play the animation and subtract 10 from the counter.
If this is just for something like a walking animation, I think there are easier ways (eg. change animation speed).

 
n/a
   

Post Reply



 



Advertisement

Worth A Click