aboutsummaryrefslogtreecommitdiff
path: root/main.wren
diff options
context:
space:
mode:
authorIndrajith K L2021-08-02 17:10:03 +0530
committerIndrajith K L2021-08-02 17:10:03 +0530
commitf2e4f563661e5203f0531e37110d060b20b2f04c (patch)
tree5d393d164896b9272dbfd85ec9cbbf24ef9c9769 /main.wren
parent7d988900e2f73992fea504419d61d4cdf759fedf (diff)
downloadrebirth-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.wren18
1 files changed, 10 insertions, 8 deletions
diff --git a/main.wren b/main.wren
index 370860e..9e94aa3 100644
--- a/main.wren
+++ b/main.wren
@@ -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)
}
}