-
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.
- doubleCircleVertical.fxml - DoubleCircleVerticalController.java - DoubleCircleVertical.java - Added class in Game.java Signed-off-by: Harsh Kumar <harsh19043@iiitd.ac.in>
- Loading branch information
Showing
5 changed files
with
94 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package obstacles; | ||
|
||
import elements.Ball; | ||
import obstacles.controllers.DoubleCircleVerticalController; | ||
|
||
public class DoubleCircleVertical extends Obstacle { | ||
private DoubleCircleVerticalController doubleCircleVerticalController; | ||
|
||
public DoubleCircleVertical() { | ||
// Load the FXML and set 'pane' in Parent | ||
loadObstaclePane("/obstacles/fxml/doubleCircleVertical.fxml"); | ||
|
||
doubleCircleVerticalController = (DoubleCircleVerticalController) controller; | ||
} | ||
|
||
@Override | ||
public int hasCollided(Ball b) { | ||
return 0; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/obstacles/controllers/DoubleCircleVerticalController.java
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 @@ | ||
package obstacles.controllers; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.layout.Pane; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
public class DoubleCircleVerticalController extends SuperController { | ||
@FXML | ||
public Pane circle1, circle2; | ||
public Pane star1, star2; | ||
|
||
public DoubleCircleVerticalController() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public void initialize(URL url, ResourceBundle resourceBundle) { | ||
// Add transitions | ||
boolean clockwise = (Math.random()*2 >= 1) ? true : false; | ||
addRotation(circle1, defaultRotatingDuration, clockwise); | ||
addRotation(circle2, defaultRotatingDuration, clockwise); | ||
loadStar(star1); | ||
loadStar(star2); | ||
} | ||
} |
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.net.*?> | ||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
|
||
<Pane xmlns:fx="http://javafx.com/fxml/1" maxHeight="500" maxWidth="250" minHeight="500" minWidth="250" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="obstacles.controllers.DoubleCircleVerticalController"> | ||
|
||
<stylesheets> | ||
<URL value="@../../style/style.css" /> | ||
</stylesheets> | ||
<Pane fx:id="circle2" layoutX="-50.0" layoutY="-51.0" rotate="45.0" scaleX="0.71" scaleY="0.71"> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="0.0" styleClass="fill-yellow" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="90.0" styleClass="fill-blue" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="180.0" styleClass="fill-pink" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="270.0" styleClass="fill-purple" type="ROUND" /> | ||
<Circle fill="WHITE" layoutX="175.0" layoutY="175.0" radius="147.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-soft-black" /> | ||
</Pane> | ||
<Pane layoutX="88.0" layoutY="87.0" prefHeight="75" prefWidth="75"> | ||
<Pane fx:id="star2" /> | ||
</Pane> | ||
|
||
<Pane fx:id="circle1" layoutX="-50.0" layoutY="199.0" rotate="-135.0" scaleX="0.71" scaleY="0.71"> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="0.0" styleClass="fill-yellow" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="90.0" styleClass="fill-blue" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="180.0" styleClass="fill-pink" type="ROUND" /> | ||
<Arc focusTraversable="true" layoutX="175.0" layoutY="175.0" length="90.0" radiusX="175.0" radiusY="175.0" startAngle="270.0" styleClass="fill-purple" type="ROUND" /> | ||
<Circle fill="WHITE" layoutX="175.0" layoutY="175.0" radius="147.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-soft-black" /> | ||
</Pane> | ||
|
||
<Pane layoutX="87.0" layoutY="340.0" prefHeight="75" prefWidth="75"> | ||
<Pane fx:id="star1" /> | ||
</Pane> | ||
</Pane> |