Added sound effect files for button clicks and mark rounding and linked them up to application. Collision audio is added too but not linked up. #story[1195]

This commit is contained in:
zwu18
2017-09-03 21:22:26 +12:00
parent abf325e5ea
commit cd685ae467
10 changed files with 18 additions and 4 deletions
@@ -8,6 +8,7 @@ import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.media.AudioClip;
import visualiser.model.RaceConnection;
import java.io.IOException;
@@ -39,6 +40,8 @@ public class LobbyController extends Controller {
private ObservableList<RaceConnection> connections;
private AudioClip sound;
@Override
public void initialize(URL location, ResourceBundle resources) {
@@ -66,6 +69,8 @@ public class LobbyController extends Controller {
* Refreshes the connections in the lobby
*/
public void refreshBtnPressed(){
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.wav").toExternalForm());
sound.play();
for(RaceConnection connection: connections) {
connection.check();
}
@@ -93,6 +98,8 @@ public class LobbyController extends Controller {
}
public void menuBtnPressed(){
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.wav").toExternalForm());
sound.play();
lobbyWrapper.setVisible(false);
parent.enterTitle();
}
@@ -101,6 +108,8 @@ public class LobbyController extends Controller {
* adds a new connection
*/
public void addConnectionPressed(){
sound = new AudioClip(this.getClass().getResource("/visualiser/sounds/buttonpress.wav").toExternalForm());
sound.play();
String hostName = addressFld.getText();
String portString = portFld.getText();
try{