15 lines
326 B
Fennel
15 lines
326 B
Fennel
(local util (require :lib.util))
|
|
(local {: vec* : vec+ : dir-from-key} (util.require :game.helpers))
|
|
(local rules (require :game.rules))
|
|
(local dim (require :game.dim))
|
|
|
|
(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
|
|
|