Easier way to register inputs

This commit is contained in:
BirDt_ 2026-04-17 19:27:23 +08:00
parent 1b759d7771
commit 190a32ac54

View file

@ -97,19 +97,7 @@
(+ (rigidbody-2d-velocity rbody) (+ (rigidbody-2d-velocity rbody)
(position transform)))))) (position transform))))))
(define-record-type <key-press> (register-action 'boost 'key-press KEY_SPACE)
(make-key-press key)
key-press?
(key key-press-key))
(add-system
(make-system 'input
0
'global
'()
(lambda ()
(when (key-pressed? KEY_SPACE)
(push-event 'input 'boost (make-key-press 'space))))))
(add-system (add-system
(make-system 'boost-rigidbody (make-system 'boost-rigidbody