Added landing sound

This commit is contained in:
Anuken
2020-04-08 22:06:43 -04:00
parent a241d6f5bb
commit 2a74bb742b
4 changed files with 18 additions and 5 deletions

BIN
core/assets/music/land.ogg Normal file

Binary file not shown.

View File

@@ -166,6 +166,10 @@ public class Control implements ApplicationListener, Loadable{
if(core == null) return; if(core == null) return;
//TODO this sounds pretty bad due to conflict
Musics.land.stop();
Musics.land.play();
app.post(() -> ui.hudfrag.showLand()); app.post(() -> ui.hudfrag.showLand());
renderer.zoomIn(Fx.coreLand.lifetime); renderer.zoomIn(Fx.coreLand.lifetime);
app.post(() -> Fx.coreLand.at(core.getX(), core.getY(), 0, core.block())); app.post(() -> Fx.coreLand.at(core.getX(), core.getY(), 0, core.block()));

View File

@@ -43,6 +43,15 @@ public class MusicControl{
darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7); darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7);
} }
public void stop(){
silenced = true;
if(current != null){
current.stop();
current = null;
fade = 0f;
}
}
/** Update and play the right music track.*/ /** Update and play the right music track.*/
public void update(){ public void update(){
if(state.isMenu()){ if(state.isMenu()){

View File

@@ -93,10 +93,10 @@ public class PlanetDialog extends FloatingDialog{
//TODO names //TODO names
buttons.addImageTextButton("$back", Icon.left, style, this::hide).margin(bmargin); buttons.addImageTextButton("$back", Icon.left, style, this::hide).margin(bmargin);
buttons.addImageTextButton("Tech", Icon.tree, style, () -> ui.tech.show()).margin(bmargin); //buttons.addImageTextButton("Tech", Icon.tree, style, () -> ui.tech.show()).margin(bmargin);
//buttons.addImageTextButton("Launch", Icon.upOpen, style, this::hide).margin(bmargin); //buttons.addImageTextButton("Launch", Icon.upOpen, style, this::hide).margin(bmargin);
buttons.addImageTextButton("Database", Icon.book, style, () -> ui.database.show()).margin(bmargin); //buttons.addImageTextButton("Database", Icon.book, style, () -> ui.database.show()).margin(bmargin);
buttons.addImageTextButton("Resources", Icon.file, style, this::hide).margin(bmargin); //buttons.addImageTextButton("Resources", Icon.file, style, this::hide).margin(bmargin);
cam.fov = 60f; cam.fov = 60f;
@@ -357,7 +357,7 @@ public class PlanetDialog extends FloatingDialog{
stable.row(); stable.row();
stable.addButton("Launch", () -> { stable.addButton("Launch", Styles.transt, () -> {
if(selected != null){ if(selected != null){
if(selected.is(SectorAttribute.naval)){ if(selected.is(SectorAttribute.naval)){
ui.showInfo("You need a naval loadout to launch here."); ui.showInfo("You need a naval loadout to launch here.");
@@ -366,7 +366,7 @@ public class PlanetDialog extends FloatingDialog{
control.playSector(selected); control.playSector(selected);
hide(); hide();
} }
}).size(120f, 50f).pad(2f); }).growX().padTop(2f).height(50f).minWidth(170f);
stable.pack(); stable.pack();
stable.setPosition(x, y, Align.center); stable.setPosition(x, y, Align.center);