Back to project page globalgamejam-mirrors.
The source code is released under:
This code and all related assets are licensed under the Attribution-Noncommercial-Share Alike 3.0 version of the Creative Commons License. Full text of the license can be found here: http://creativec...
If you think the Android project globalgamejam-mirrors listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.w131.globalgamejam.mirrors; //w w w .j ava 2 s . c om import com.badlogic.gdx.Gdx; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.audio.Sound; public class SoundController { private final static Music bgMusic = Gdx.audio.newMusic(Gdx.files.internal("sounds/MirrorsMaster_01.ogg")); private final static Sound spawn = Gdx.audio.newSound(Gdx.files.internal("sounds/Spawn.ogg")); public static void playBGMusic() { bgMusic.setVolume(0.25f); bgMusic.play(); if (bgMusic.isLooping() == false) { bgMusic.setLooping(true); } } public static void toggleBGMusic() { if(bgMusic.isPlaying()) { bgMusic.pause(); } else { bgMusic.play(); } } public static void pauseBGMusic() { bgMusic.pause(); } public static void stopBGMusic() { bgMusic.stop(); } public static void playSpawn() { spawn.play(0.25f); } public static void dispose() { bgMusic.dispose(); spawn.dispose(); } }