-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- triangle.fxml - TriangleController.java - Triangle.java - Added class in Game.java Signed-off-by: Harsh Kumar <harsh19043@iiitd.ac.in>
- Loading branch information
Showing
6 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package obstacles; | ||
|
||
import elements.Ball; | ||
import obstacles.controllers.TriangleController; | ||
|
||
public class Triangle extends Obstacle { | ||
private TriangleController triangleController; | ||
|
||
public Triangle() { | ||
// Load the FXML and set 'pane' in Parent | ||
loadObstaclePane("/obstacles/fxml/triangle.fxml"); | ||
|
||
triangleController = (TriangleController) controller; | ||
} | ||
|
||
@Override | ||
public int hasCollided(Ball b) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package obstacles.controllers; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.layout.Pane; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
public class TriangleController extends SuperController { | ||
@FXML | ||
public Pane triangle; | ||
|
||
public TriangleController() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public void initialize(URL url, ResourceBundle resourceBundle) { | ||
// Add transitions | ||
addRotation(triangle); | ||
loadStar(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.net.*?> | ||
<?import javafx.geometry.*?> | ||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
|
||
<Pane xmlns:fx="http://javafx.com/fxml/1" maxHeight="350" maxWidth="350" minHeight="350" minWidth="350" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="obstacles.controllers.TriangleController"> | ||
|
||
<stylesheets> | ||
<URL value="@../../style/style.css" /> | ||
</stylesheets> | ||
|
||
<Pane> | ||
<Pane fx:id="triangle" layoutX="-4.0" layoutY="16.0" prefHeight="350" prefWidth="350.0" scaleX="0.9" scaleY="0.9"> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" height="350.0" layoutX="252.0" layoutY="-47.0" rotate="150.0" styleClass="fill-purple" width="28.0" /> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" height="28.0" layoutX="5.0" layoutY="258.0" styleClass="fill-pink" width="350.0" /> | ||
<Rectangle arcHeight="5.0" arcWidth="5.0" height="350.0" layoutX="81.0" layoutY="-45.0" rotate="30.0" styleClass="fill-yellow" width="28.0" /> | ||
<padding> | ||
<Insets bottom="25.0" /> | ||
</padding> | ||
</Pane> | ||
<Pane layoutX="137.0" layoutY="149.0" prefHeight="75" prefWidth="75"> | ||
<Pane fx:id="star" /> | ||
</Pane> | ||
</Pane> | ||
</Pane> |