Skip to content

Commit

Permalink
feat: AudioManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-shop committed May 11, 2023
1 parent 9c44cf2 commit c4eb8f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
File renamed without changes.
18 changes: 18 additions & 0 deletions app/src/main/java/net/imshit/aircraftwar/logic/AudioManager.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.imshit.aircraftwar.logic

import android.content.Context
import android.content.res.AssetFileDescriptor

class AudioManager(context: Context) {
private val getAfd: (String) -> AssetFileDescriptor = { fileName ->
context.assets.openFd("audio/$fileName")
}

val bgmBoss = getAfd("game_bgm_boss.wav")
val bgmNormal = getAfd("game_bgm_normal.wav")
val bulletHit = getAfd("game_bullet_hit.wav")
val bulletShoot = getAfd("game_bullet_shoot.wav")
val explode = getAfd("game_explode.wav")
val gameOver = getAfd("game_game_over.wav")
val supplyGet = getAfd("game_supply_get.wav")
}

0 comments on commit c4eb8f9

Please sign in to comment.