Initial simple event manager.

This commit is contained in:
2026-09-15 05:42:12 +02:00
parent 106f8195e2
commit cb523a3d6f
3 changed files with 36 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
package game
// all possible game events
Event_Type :: enum {
Game_Over,
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)
}