bomberpac/game/entity.fnl

15 lines
326 B
Plaintext
Raw Normal View History

2021-02-07 21:56:19 +00:00
(local util (require :lib.util))
(local {: vec* : vec+ : dir-from-key} (util.require :game.helpers))
2021-02-07 21:56:19 +00:00
(local rules (require :game.rules))
(local dim (require :game.dim))
2021-02-07 21:56:19 +00:00
(local entity {})
(fn entity.move [pos vel dt]
(vec+ pos (vec* vel dt)))
(fn entity.direct [keymap speed]
(vec* (dir-from-key keymap) speed))
entity
2021-02-07 21:56:19 +00:00