Made animation testing same as everyother class, can run from other classes.

This commit is contained in:
2019-03-23 19:04:37 -06:00
parent 7ec7f00983
commit cf287833f6

View File

@@ -16,24 +16,27 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class AnimationTesting extends Application {
public class AnimationTesting extends Player {
private ShipWarfareGUI ship;
private HBox usAgainstEnemyDivisor;
private BorderPane centeringUserShipPane;
private Circle cannon;
private BorderPane centeringMerchantShipPane;
private BorderPane encompassingPane;
public AnimationTesting() throws FileNotFoundException{
/**
* constructor; only runs when a Player object is provided. The constructor is fully encapsulated.
*
* @param player is a Player object that will be copied and the player instance variable is set to the copy.
*/
public AnimationTesting(Player player) {
Player playerDummy = new Player(player);
this.ship = new ShipWarfareGUI(player);
setPlayer(playerDummy);
}
public static void main(String[] args) {
launch(args);
}
public void start(Stage primaryStage) throws Exception {
public void startShipAnimation(Stage primaryStage) throws Exception {
Pane root = new Pane();
@@ -114,7 +117,9 @@ public class AnimationTesting extends Application {
shotsFired.setNode(cannon);
shotsFired.play();
Scene scene = new Scene(root);
Scene scene = new Scene(root,600,480);
root.getStylesheets().add("styleguide.css");
primaryStage.setScene(scene);
primaryStage.show();