aboutsummaryrefslogtreecommitdiff
path: root/game_state.wren
diff options
context:
space:
mode:
authorIndrajith K L2021-08-03 17:53:10 +0530
committerIndrajith K L2021-08-03 17:53:10 +0530
commit705886d371cf2cfa619b321c0d87caca0773a789 (patch)
tree0e860ca10c6cfd122b403b02e84d4fef72078b63 /game_state.wren
parent5bd12d5a658c1cd710bc950be971ebe3993ed11d (diff)
downloadrebirth-wren-705886d371cf2cfa619b321c0d87caca0773a789.tar.gz
rebirth-wren-705886d371cf2cfa619b321c0d87caca0773a789.tar.bz2
rebirth-wren-705886d371cf2cfa619b321c0d87caca0773a789.zip
Bug Fixes
Player Placement Basic Player Movement
Diffstat (limited to 'game_state.wren')
-rw-r--r--game_state.wren21
1 files changed, 18 insertions, 3 deletions
diff --git a/game_state.wren b/game_state.wren
index 9390261..42e1189 100644
--- a/game_state.wren
+++ b/game_state.wren
@@ -1,12 +1,27 @@
import "audio" for AudioEngine
import "dome" for Window
-
+import "screens/menu_screen" for MenuScreen
+import "screens/credit_screen" for CreditScreen
+import "levels/level1" for Level1
+import "levels/level2" for Level2
class GameState {
construct new() {
AudioEngine.load("menu_music","assets/musics/04 All of Us - Menu.ogg")
AudioEngine.load("level1_bg","assets/musics/01 A Night Of Dizzy Spells.ogg")
AudioEngine.load("select","assets/sfx/select.wav")
+ AudioEngine.load("credit","assets/musics/Juhani Junkala [Retro Game Music Pack] Ending.wav")
_fullScreen = false
+
+ setupStates()
+ }
+
+ setupStates() {
+ __gameStates = {
+ "menu": MenuScreen,
+ "credit": CreditScreen,
+ "level1": Level1,
+ "level2": Level2
+ }
}
toggleFullscreen() {
@@ -16,8 +31,8 @@ class GameState {
switch(level) {
AudioEngine.stopAllChannels()
- _currentLevel = level.new(this)
- System.print("Current Level : %(level.name)")
+ _currentLevel = __gameStates[level].new(this)
+ System.print("Current Level : %(__gameStates[level].name)")
}
update() {