Currently, the Component struct contains an event for detecting change in the level, but not in cubes, platforms and buttons.
With this added, the struct would look as follows:
struct Component {
id: int,
conflicts_with: List<int>,
draw_hud_text: fn(string) -> string,
draw_hud_always: fn(),
tick_mode: TickMode,
// largest delta time wins and is used for the next frame
requested_delta_time: Option<float>,
on_tick: fn(),
on_yield: fn(),
on_new_game: fn(),
on_level_change: fn(int, int),
on_buttons_change: fn(int, int),
on_cubes_change: fn(int, int),
on_platforms_change: fn(int, int),
on_reset: fn(int, int),
on_element_pressed: fn(ElementIndex),
on_element_released: fn(ElementIndex),
on_key_down: fn(KeyCode, bool),
/// triggered even when in the menu
on_key_down_always: fn(KeyCode, bool),
on_key_up: fn(KeyCode),
/// triggered even when in the menu
on_key_up_always: fn(KeyCode),
on_mouse_move: fn(int, int),
on_component_enter: fn(),
on_component_exit: fn(),
on_resolution_change: fn(),
on_menu_open: fn(),
}
Currently, the
Component
struct contains an event for detecting change in the level, but not in cubes, platforms and buttons.With this added, the struct would look as follows: