Tutorial is played with tutorial map.

#story[1261]
This commit is contained in:
Jessica Syder
2017-09-12 16:23:11 +12:00
parent 0cb008cef7
commit e664619a81
2 changed files with 9 additions and 2 deletions
@@ -67,7 +67,7 @@ public class HostGameController extends Controller {
* @param address address of the server * @param address address of the server
* @param port port that the server is run off * @param port port that the server is run off
*/ */
private void connectSocket(String address, int port) throws IOException { public void connectSocket(String address, int port) throws IOException {
Socket socket = new Socket(address, port); Socket socket = new Socket(address, port);
RaceStartController rsc = (RaceStartController)loadScene("raceStart.fxml"); RaceStartController rsc = (RaceStartController)loadScene("raceStart.fxml");
rsc.enterLobby(socket, true); rsc.enterLobby(socket, true);
@@ -110,4 +110,8 @@ public class HostGameController extends Controller {
mapImage.setImage(listOfMaps.get(currentMapIndex)); mapImage.setImage(listOfMaps.get(currentMapIndex));
} }
public void setCurrentMapIndex(Integer index){
this.currentMapIndex = index;
}
} }
@@ -7,6 +7,7 @@ import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.stage.Modality; import javafx.stage.Modality;
import mock.exceptions.EventConstructionException;
import visualiser.app.App; import visualiser.app.App;
import java.io.IOException; import java.io.IOException;
@@ -80,9 +81,11 @@ public class TitleController extends Controller {
} }
} }
public void tutorialStartPressed() { public void tutorialStartPressed() throws IOException,
EventConstructionException {
App.gameType = 4; App.gameType = 4;
HostGameController hgc = new HostGameController(); HostGameController hgc = new HostGameController();
hgc.setCurrentMapIndex(4);
hgc.hostGamePressed(); hgc.hostGamePressed();
} }