Made animation testing same as everyother class, can run from other classes.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user