Files
pong_raylib/src/event_manager.odin
T
2026-09-16 07:54:08 +02:00

30 lines
497 B
Odin

package game
// all possible game events
Event_Type :: enum {
Game_Start,
Game_Over,
Game_Quit,
Game_Pause,
Game_Resume,
Game_Main_Menu,
Score_Change,
Ball_Collision,
}
// optional details attached to an event
Event :: struct {
type: Event_Type,
winner_is_player: bool,
}
// global event storage
GLOBAL_EVENTS: [dynamic]Event
emit_event :: proc(event: Event) {
append(&GLOBAL_EVENTS, event)
}
flush_events :: proc() {
clear(&GLOBAL_EVENTS)
}