Commit e70adb99 authored by Nils Hein's avatar Nils Hein
Browse files

Fixed Music loop

parent b60a029b
......@@ -7,6 +7,7 @@ import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
......@@ -88,7 +89,7 @@ public class FrozenNumbersGame extends ApplicationAdapter {
// sounds
assets.load("snd/hit.mp3", Sound.class);
assets.load("snd/shot.mp3", Sound.class);
assets.load("snd/theme.ogg", Sound.class);
assets.load("snd/theme.ogg", Music.class);
assets.load("snd/pop.mp3", Sound.class);
assets.finishLoading();
......
......@@ -3,6 +3,7 @@ package org.milderjoghurt.frozennumbers.screens;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
......@@ -55,7 +56,10 @@ public class GameOverScreen implements Screen {
closeTop.rotate(180);
closeTop.setCenter(wWidth / 4.0f * 3.0f, wHeight / 2.0f);
FrozenNumbersGame.assets.get("snd/theme.ogg", Sound.class).loop();
Music m = FrozenNumbersGame.assets.get("snd/theme.ogg", Music.class);
m.setLooping(true);
m.play();
}
@Override
......
......@@ -3,6 +3,7 @@ package org.milderjoghurt.frozennumbers.screens;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
......@@ -64,7 +65,9 @@ public class MainMenuScreen implements Screen {
p1_isready = false;
p2_isready = false;
FrozenNumbersGame.assets.get("snd/theme.ogg", Sound.class).loop();
Music theme = FrozenNumbersGame.assets.get("snd/theme.ogg", Music.class);
theme.setLooping(true);
theme.play();
}
@Override
......@@ -141,7 +144,7 @@ public class MainMenuScreen implements Screen {
if (p1_isready && p2_isready) {
//reset for new Game
m_Screens.put("Game", new GameScreen());
FrozenNumbersGame.assets.get("snd/theme.ogg", Sound.class).stop();
FrozenNumbersGame.assets.get("snd/theme.ogg", Music.class).stop();
p1_ready.setTexture(FrozenNumbersGame.assets.get("sprites/btn_ready_inactive.png", Texture.class));
p2_ready.setTexture(FrozenNumbersGame.assets.get("sprites/btn_ready_inactive.png", Texture.class));
p2_ready.setColor(1, 1, 1, 1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment