aboutsummaryrefslogtreecommitdiff
path: root/game_state.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 /game_state.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 'game_state.wren')
-rw-r--r--game_state.wren14
1 files changed, 13 insertions, 1 deletions
diff --git a/game_state.wren b/game_state.wren
index 94e8a99..4794fb7 100644
--- a/game_state.wren
+++ b/game_state.wren
@@ -1,10 +1,22 @@
+import "audio" for AudioEngine
+import "dome" for Window
+
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")
+ _fullScreen = false
+ }
+ toggleFullscreen() {
+ _fullScreen = !_fullScreen
+ Window.fullscreen = _fullScreen
}
switch(level) {
- _currentLevel = level.new()
+ AudioEngine.stopAllChannels()
+ _currentLevel = level.new(this)
+ System.print("Current Level : %(level.name)")
}
update() {