2021-02-07 21:56:19 +00:00
|
|
|
(local state (require :game.state))
|
2021-03-07 16:55:50 +00:00
|
|
|
(local map (require :game.tilemap))
|
|
|
|
(local rules (require :game.rules))
|
2021-02-07 21:56:19 +00:00
|
|
|
|
|
|
|
(fn update [dt]
|
2021-03-07 16:55:50 +00:00
|
|
|
(map.update-entitymap state.bombs dt rules)
|
2021-02-07 21:56:19 +00:00
|
|
|
(each [_ entity (ipairs state.entities)]
|
2021-03-07 16:55:50 +00:00
|
|
|
(entity:update dt rules)))
|
2021-02-07 21:56:19 +00:00
|
|
|
|
|
|
|
(fn draw []
|
2021-03-07 16:55:50 +00:00
|
|
|
(map.draw-tilemaps 0 0 [state.bombs state.map])
|
2021-02-07 21:56:19 +00:00
|
|
|
(each [_ entity (ipairs state.entities)]
|
|
|
|
(entity:draw)))
|
|
|
|
|
|
|
|
{: update : draw}
|
|
|
|
|