2021-02-07 21:56:19 +00:00
|
|
|
(local util (require :lib.util))
|
|
|
|
(local modes (require :editor.lovemode))
|
|
|
|
(local ModeView (require :editor.modeview))
|
|
|
|
(local state (require :game.state))
|
|
|
|
(local core (require :core))
|
|
|
|
(local command (require :core.command))
|
|
|
|
|
|
|
|
(local gamemode (require :game.mode))
|
2021-03-07 16:55:50 +00:00
|
|
|
(local SpaceOrb (require :game.orb))
|
|
|
|
(local map (require :game.tilemap))
|
|
|
|
(local tile (require :game.tiles))
|
|
|
|
(local bomberman (require :game.entities.bomberman))
|
2021-03-28 19:23:08 +00:00
|
|
|
(local rules (require :game.rules))
|
2021-03-07 16:55:50 +00:00
|
|
|
|
2021-02-07 21:56:19 +00:00
|
|
|
(modes:register :game gamemode)
|
|
|
|
|
2021-03-28 19:23:08 +00:00
|
|
|
(set state.entities [(bomberman.new [48 48])])
|
2021-03-07 16:55:50 +00:00
|
|
|
(set state.map (map.new-tilemap 28 31 tile.bombertile (tile.itile-named tile.bombertile :empty)))
|
|
|
|
(set state.bombs (map.new-entitymap state.map.w state.map.h))
|
2021-03-28 19:23:08 +00:00
|
|
|
(rules.generate-maze state.map)
|
2021-02-07 21:56:19 +00:00
|
|
|
|
|
|
|
(command.add nil {
|
|
|
|
"love:game" (fn []
|
|
|
|
(let [node (core.root_view:get_active_node)]
|
|
|
|
(node:add_view (ModeView gamemode))))
|
2021-03-28 19:23:08 +00:00
|
|
|
"love:regenerate-maze" #(rules.generate-maze state.map)
|
2021-02-07 21:56:19 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
{}
|