diff options
author | Indrajith K L | 2021-08-02 17:10:03 +0530 |
---|---|---|
committer | Indrajith K L | 2021-08-02 17:10:03 +0530 |
commit | f2e4f563661e5203f0531e37110d060b20b2f04c (patch) | |
tree | 5d393d164896b9272dbfd85ec9cbbf24ef9c9769 /main.wren | |
parent | 7d988900e2f73992fea504419d61d4cdf759fedf (diff) | |
download | rebirth-wren-f2e4f563661e5203f0531e37110d060b20b2f04c.tar.gz rebirth-wren-f2e4f563661e5203f0531e37110d060b20b2f04c.tar.bz2 rebirth-wren-f2e4f563661e5203f0531e37110d060b20b2f04c.zip |
* Adds Music Management
* Code Refactoring
* Adds Fonts
Diffstat (limited to 'main.wren')
-rw-r--r-- | main.wren | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -4,31 +4,33 @@ import "graphics" for Canvas, Color import "dome" for Window, Process import "math" for Math import "config" for Config -import "input" for Keyboard import "./controls" for Controls import "./game_state" for GameState -import "./levels/level1" for Level1 +import "./levels/menu" for Menu class Main { construct new() { - Config.setup() - __gameState = GameState.new() - __gameState.switch(Level1) } init() { - + Config.new() + __gameState = GameState.new() + __gameState.switch(Menu) } update() { - if(Controls.detect(Config.KeyboardConstants["QUIT"])) { + if(Controls.isKeyDown(Config.KeyboardConstants["QUIT"])) { Process.exit(0) } + + if(Controls.justPressed(Config.KeyboardConstants["FULLSCREEN"])) { + __gameState.toggleFullscreen() + } __gameState.update() } draw(dt) { - Canvas.cls(Color.pink) + Canvas.cls(Color.black) __gameState.draw(dt) } } |