CE Timer Component
Timer component
Example
/// @desc Create
ce_init_components();
timer_component = ce_add_component(id, ce_timer_component);
spawn_delay = 60000;
spawn_object = OEnemy;
spawn_timer = ce_add_timer(timer_component, spawn_delay);
/// @desc Step
ce_call_components("on_update");
/// @desc User Event
switch (ce_get_event())
{
case CE_EV_TIMEOUT:
var _timer = ce_get_event_data();
if (_timer == spawn_timer)
{
instance_create_layer(x, y, layer, spawn_object);
spawn_timer = ce_add_timer(timer_component, spawn_delay);
}
break;
}
Installation
Using Catalyst, the open-source package manager for GameMaker Studio 2:
catalyst require slagtand-org/ce-timer-component
Related
This library is a part of project CE. For more information, please visit the project's repository: https://github.com/slagtand-org/ce