Sounds
This commit is contained in:
parent
bc2a200beb
commit
fdae895cf9
4 changed files with 6 additions and 1 deletions
BIN
core/assets/sounds/colourchange.mp3
Normal file
BIN
core/assets/sounds/colourchange.mp3
Normal file
Binary file not shown.
Binary file not shown.
|
@ -112,6 +112,7 @@ public class Loading extends AbstractScreen {
|
|||
app.assets.load("textures/player_blue.png", Texture.class);
|
||||
|
||||
app.assets.load("sounds/jumping.mp3", Sound.class);
|
||||
app.assets.load("sounds/colourchange.mp3", Sound.class);
|
||||
|
||||
app.assets.load("music/TheComplex.mp3", Music.class);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ public class Play extends AbstractScreen {
|
|||
private int levelNumber;
|
||||
|
||||
private Sound jumpSound = Gdx.audio.newSound(Gdx.files.internal("sounds/jumping.mp3"));
|
||||
private Sound colourchangeSound = Gdx.audio.newSound(Gdx.files.internal("sounds/colourchange.mp3"));
|
||||
|
||||
public Play(App app, int levelNumber) {
|
||||
super(app);
|
||||
|
@ -178,7 +179,7 @@ public class Play extends AbstractScreen {
|
|||
public void handleInput() {
|
||||
if(Gdx.input.isKeyPressed(Input.Keys.SPACE))
|
||||
{
|
||||
//jumpSound.play(); //TODO, fix sound?
|
||||
jumpSound.play();
|
||||
player.jump();
|
||||
}
|
||||
|
||||
|
@ -190,16 +191,19 @@ public class Play extends AbstractScreen {
|
|||
|
||||
if(Gdx.input.isKeyJustPressed(Input.Keys.NUM_1))
|
||||
{
|
||||
colourchangeSound.play();
|
||||
player.setCurColour(Base.Colours.RED);
|
||||
}
|
||||
|
||||
if(Gdx.input.isKeyJustPressed(Input.Keys.NUM_2))
|
||||
{
|
||||
colourchangeSound.play();
|
||||
player.setCurColour(Base.Colours.GREEN);
|
||||
}
|
||||
|
||||
if(Gdx.input.isKeyJustPressed(Input.Keys.NUM_3))
|
||||
{
|
||||
colourchangeSound.play();
|
||||
player.setCurColour(Base.Colours.BLUE);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue