Skip to content

Commit

Permalink
It plays moosic
Browse files Browse the repository at this point in the history
  • Loading branch information
Amos Wenger committed Aug 28, 2012
1 parent 88e9eb9 commit e6bf393
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Binary file added assets/ogg/music/swing.ogg
Binary file not shown.
Binary file added assets/ogg/music/valse.ogg
Binary file not shown.
23 changes: 21 additions & 2 deletions source/bioboy.ooc
Expand Up @@ -2,7 +2,7 @@
use zombieconfig, ldkit, deadlogger use zombieconfig, ldkit, deadlogger


import zombieconfig import zombieconfig
import ldkit/[Engine, Dead, Math, Sprites, UI, Actor] import ldkit/[Engine, Dead, Math, Sprites, UI, Actor, Sound]
import deadlogger/Logger import deadlogger/Logger
import structs/ArrayList import structs/ArrayList


Expand All @@ -14,10 +14,15 @@ main: func (args: ArrayList<String>) {


Game: class extends Actor { Game: class extends Actor {


musics := ["spywillie", "castle", "drama", "valse"] as ArrayList<String>
musicSource: Source
currentMusic := 0

levelSelect: LevelSelect levelSelect: LevelSelect
level: Level level: Level
story: Story story: Story
menu: Menu menu: Menu
engine: Engine
instructions: Instructions instructions: Instructions


shouldSelectLevels := false shouldSelectLevels := false
Expand All @@ -37,7 +42,7 @@ Game: class extends Actor {
) )
logger info("configuration loaded from %s" format(configPath)) logger info("configuration loaded from %s" format(configPath))


engine := Engine new(config) engine = Engine new(config)


// customize UI a bit // customize UI a bit
engine ui mousePass enabled = false engine ui mousePass enabled = false
Expand Down Expand Up @@ -77,9 +82,23 @@ Game: class extends Actor {
) )
story loadCard() story loadCard()


play(musicPath())

engine add(this) engine add(this)
engine run() engine run()
}

play: func (path: String) {
if (musicSource) {
musicSource free()
}

sample := engine ui boombox load(path)
musicSource = engine ui boombox play(sample)
}


musicPath: func -> String {
"assets/ogg/music/%s.ogg" format(musics get(currentMusic))
} }


scheduleLevelSelect: func { scheduleLevelSelect: func {
Expand Down

0 comments on commit e6bf393

Please sign in to comment.