* Adds Music Management

* Code Refactoring
* Adds Fonts
This commit is contained in:
Indrajith K L
2021-08-02 17:10:03 +05:30
parent 7d988900e2
commit f2e4f56366
12 changed files with 146 additions and 93 deletions

View File

@@ -1,9 +1,12 @@
import "./level_map" for LevelMap
import "audio" for AudioEngine
class Level1 {
construct new() {
construct new(gameState) {
_level1 = LevelMap.new("level1")
var channel = AudioEngine.play("level1_bg")
channel.volume = 0.2
}
update() {
}

25
levels/menu.wren Normal file
View File

@@ -0,0 +1,25 @@
import "graphics" for Canvas, Color
import "./controls" for Controls
import "config" for Config
import "levels/level1" for Level1
import "audio" for AudioEngine
import "font" for Font
class Menu {
construct new(gameState) {
__gameState = gameState
var channel = AudioEngine.play("menu_music")
channel.volume = 0.5
Canvas.font = "font_medium"
}
update() {
if(Controls.isKeyDown(Config.KeyboardConstants["SELECT"])) {
__gameState.switch(Level1)
}
}
draw(dt) {
Canvas.print("REBIRTH",Config.W/2 - 40,Config.H/2 - 20, Color.white)
}
}