room_speed


Description

This variable holds the running speed of all rooms (and the game) in game frames per second. Note that this is NOT the FPS (frames per second) but rather the number of game steps that GameMaker Studio 2 will try to maintain each second.

IMPORTANT! This variable is maintained for Legacy Support only, and should not be used as it no longer sets the speed for a single room, but for ALL rooms in the game. To change game speed you should instead be using the function game_set_speed.


Syntax:

room_speed;


Returns:

Real


Example:

alarm[0] = room_speed * 10;

The above code uses room_speed to set an alarm to run for 10 seconds. Using the variable in this way will ensure that the alarm runs for 10 seconds, no matter what speed is set for the room.


Back: General Room Functions And Variables
Next: room_height
© Copyright YoYo Games Ltd. 2018 All Rights Reserved