Using slow motion
John Woo had it right: slow motion makes things look way cooler. Well, as far as action goes, anyway. How many games since the late 90s have made use of slow motion in one way or another? It often comes in the form of some kind of power up or usage meter, but it's there and it's a lot of fun. Do you want to add slow motion to your game? Let's take a look at one way in which you can accomplish this using GameMaker.
Getting ready
To make things simpler, we'll continue to use the project file from the two previous recipes. In addition to this, who doesn't want to see explosions in slow motion? You won't need to create any new objects here, but we'll be working with obj_control
.
How to do it...
In the Create event of
obj_control
, add the following code:globalvar timeSpeed; globalvar slowMo; slowMo = false; timeSpeed = 1;
In the Step event, add the following code before the first line of code:
room_speed = round(60*timeSpeed);
In the same code block, add the following code after the...