From eb9466c8d3d18d65eb4bab2f6770f55cba9d8de3 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Sat, 9 May 2026 18:38:21 -0700 Subject: Adding a simple grid-based camera --- util.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util.lua') diff --git a/util.lua b/util.lua index 5d31a2a..5fd41d3 100644 --- a/util.lua +++ b/util.lua @@ -1,5 +1,9 @@ update_hooks = {} +function AddUpdateHook(f) + update_hooks[#update_hooks + 1] = f +end + -- https://pico-8.fandom.com/wiki/Qsort function qsort(a, c, l, r) c, l, r = c or function(a, b) return a < b end, l or 1, r or #a @@ -99,7 +103,7 @@ function _update_button_states(_dt) end end end -update_hooks[1] = _update_button_states +AddUpdateHook(_update_button_states) function button_just_pressed(id) return _button_states[id] == "just_pressed" end \ No newline at end of file -- cgit v1.3