aboutsummaryrefslogtreecommitdiff
path: root/main.wren
diff options
context:
space:
mode:
authorIndrajith K L2021-08-02 13:48:25 +0530
committerIndrajith K L2021-08-02 13:48:25 +0530
commit7d988900e2f73992fea504419d61d4cdf759fedf (patch)
treea722fc38bcd7d9b4155c54b32acf9a5dc44cfdd9 /main.wren
parent2ff207a1d30830aeca2ea9e5d085a55ee3448ab0 (diff)
downloadrebirth-wren-7d988900e2f73992fea504419d61d4cdf759fedf.tar.gz
rebirth-wren-7d988900e2f73992fea504419d61d4cdf759fedf.tar.bz2
rebirth-wren-7d988900e2f73992fea504419d61d4cdf759fedf.zip
* Basic Game State Implementation
* Code Refactoring
Diffstat (limited to 'main.wren')
-rw-r--r--main.wren11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.wren b/main.wren
index 7e39844..370860e 100644
--- a/main.wren
+++ b/main.wren
@@ -6,12 +6,14 @@ import "math" for Math
import "config" for Config
import "input" for Keyboard
import "./controls" for Controls
-import "./level" for Level
+import "./game_state" for GameState
+import "./levels/level1" for Level1
class Main {
construct new() {
Config.setup()
- __level = Level.new("level1")
+ __gameState = GameState.new()
+ __gameState.switch(Level1)
}
init() {
@@ -22,11 +24,12 @@ class Main {
if(Controls.detect(Config.KeyboardConstants["QUIT"])) {
Process.exit(0)
}
+ __gameState.update()
}
- draw(alpha) {
+ draw(dt) {
Canvas.cls(Color.pink)
- __level.draw(0,0)
+ __gameState.draw(dt)
}
}