room_persistent

Holds the state of the persistent flag of the room.

Syntax:

room_persistent;


Returns: Boolean


Description

This variable can be used to get and to set the persistent flag for the current room. If set to true the room is considered persistent, in which case each time you leave the room and come back again the state of the instances within that room will have been maintains. However if it is flagged as false, each time you return to the room it will be reset to its initial state. You should note that a persistent room uses considerably more memory than a normal room and it is not recommended to have too many of them in your game.


Example:

if lives < 1
   {
   room_persistent = false;
   room_goto(rm_start);
   }

The above code checks the variable "lives" and if it is less than 1, it will set the room persistence to false and then change rooms.


Back: Rooms
Next: room_caption
© Copyright YoYo Games Ltd. 2018 All Rights Reserved