GML: alarm[ ]
( Game Maker 6.1, 7 )
alarm is a built in local array that contains the current value of each alarm in an object. Each object has 12 such alarms, alarm[0] to alarm[11].
Examples
Setting an Alarm
alarm[0] = 120;
This will set alarm0 to 120 steps (four seconds in if your room is set to 30 steps per second), at which time alarm0 event will trigger.
Setting an Alarm in Seconds
Since the room_speed is the number of steps per second, you can use it to set an alarm for a number of seconds:
alarm[0] = room_speed * 10;
In this example, the alarm will be set to 10 seconds.
Setting an Alarm in Minutes
alarm[0] = room_speed * 60 * 2;
This will set the alarm for two minutes.
Tips / Hints
- If you need an alarm to trigger more than once, remember to set the alarm in itself.
Related Pages
Actions
Events
- Alarm - what happens when an alarm goes off.
FAQs
Lists
- list of arrays - a list of built-in Game Maker arrays
Backlinks
These pages link to this page. They may be useful.
| Categories: GML : Timing : Variables |