-
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.
Signed-off-by: Harsh Kumar <harsh19043@iiitd.ac.in>
- Loading branch information
Showing
15 changed files
with
261 additions
and
20 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,51 @@ | ||
package elements; | ||
|
||
import javafx.animation.Animation; | ||
import javafx.animation.Interpolator; | ||
import javafx.animation.RotateTransition; | ||
import javafx.animation.TranslateTransition; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.Node; | ||
import javafx.scene.layout.Pane; | ||
import javafx.scene.transform.Rotate; | ||
import javafx.util.Duration; | ||
|
||
import java.net.URL; | ||
import java.util.ArrayList; | ||
import java.util.ResourceBundle; | ||
|
||
public class ElementsController implements Initializable { | ||
static int defaultRotatingDuration = 4000; | ||
|
||
ArrayList<RotateTransition> rotatingElements; | ||
@FXML | ||
Pane ball; | ||
|
||
private void addRotatingNode(Node node, int timeInMillis, boolean clockwise) { | ||
RotateTransition rt = new RotateTransition(); | ||
rt.setAxis(Rotate.Z_AXIS); | ||
rt.setByAngle((clockwise) ? 360 : -360); | ||
rt.setCycleCount(Animation.INDEFINITE); | ||
rt.setInterpolator(Interpolator.LINEAR); | ||
rt.setDuration(Duration.millis(timeInMillis)); | ||
rt.setNode(node); | ||
rt.play(); | ||
} | ||
|
||
private void addRotatingNode(Node node) { | ||
addRotatingNode(node, defaultRotatingDuration, true); | ||
} | ||
|
||
@Override | ||
public void initialize(URL url, ResourceBundle resourceBundle) { | ||
rotatingElements = new ArrayList<>(); | ||
TranslateTransition tt = new TranslateTransition(); | ||
tt.setByY(-100); | ||
tt.setDuration(Duration.millis(500)); | ||
tt.setCycleCount(Animation.INDEFINITE); | ||
tt.setAutoReverse(true); | ||
tt.setNode(ball); | ||
tt.play(); | ||
} | ||
} |
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
|
||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="ball" minHeight="28.0" minWidth="28.0" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="elements.ElementsController"> | ||
<children> | ||
<Circle fill="DODGERBLUE" layoutX="14.0" layoutY="14.0" radius="14.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-pink" /> | ||
</children> | ||
</Pane> |
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
|
||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="colourSwitcher" minHeight="28.0" minWidth="28.0" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="elements.ElementsController"> | ||
<children> | ||
<Arc layoutX="14" layoutY="14" length="90.0" radiusX="14.0" radiusY="14.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-yellow" type="ROUND" /> | ||
<Arc layoutX="14" layoutY="14" length="90.0" radiusX="14.0" radiusY="14.0" startAngle="90.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-pink" type="ROUND" /> | ||
<Arc layoutX="14" layoutY="14" length="90.0" radiusX="14.0" radiusY="14.0" startAngle="180.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-blue" type="ROUND" /> | ||
<Arc layoutX="14" layoutY="14" length="90.0" radiusX="14.0" radiusY="14.0" startAngle="270.0" stroke="BLACK" strokeType="INSIDE" styleClass="fill-purple" type="ROUND" /> | ||
</children> | ||
</Pane> |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.image.Image?> | ||
<?import javafx.scene.image.ImageView?> | ||
<?import javafx.scene.layout.Pane?> | ||
<Pane xmlns:fx="http://javafx.com/fxml/1" fx:id="star" minHeight="75.0" maxHeight="75" minWidth="75.0" maxWidth="75" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="elements.ElementsController"> | ||
<ImageView fitWidth="75" fitHeight="75"> | ||
<Image url="@../assets/game/star.png" /> | ||
</ImageView> | ||
</Pane> | ||
|
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
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,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.lang.*?> | ||
<?import java.net.*?> | ||
<?import javafx.geometry.*?> | ||
<?import javafx.scene.*?> | ||
<?import javafx.scene.image.*?> | ||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.shape.*?> | ||
<?import javafx.scene.text.*?> | ||
|
||
<BorderPane xmlns:fx="http://javafx.com/fxml/1" minHeight="1024" minWidth="768" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="Controller"> | ||
<center> | ||
<Pane fx:id="obstaclesBox" maxHeight="1024" maxWidth="768" minHeight="1024" minWidth="768"> | ||
<Pane layoutX="214.0" layoutY="-20.0" mouseTransparent="true" prefHeight="340.0" prefWidth="340.0"> | ||
<Pane fx:id="box" /> | ||
</Pane> | ||
|
||
<VBox alignment="CENTER" layoutX="219.0" layoutY="393.0" opacity="0.7" scaleX="0.75" scaleY="0.75"> | ||
<FlowPane prefHeight="134.0" prefWidth="213.0"> | ||
<Text styleClass="home-heading" text="C" /> | ||
|
||
<ImageView fx:id="ring_4"> | ||
<Image requestedHeight="65" requestedWidth="65" url="@../assets/home/circle.png" /> | ||
<FlowPane.margin> | ||
<Insets bottom="25.0" left="10.0" right="10.0" /> | ||
</FlowPane.margin> | ||
</ImageView> | ||
|
||
<Text styleClass="home-heading" text="L" /> | ||
|
||
<ImageView fx:id="ring_5"> | ||
<Image requestedHeight="65" requestedWidth="65" url="@../assets/home/circle.png" /> | ||
<FlowPane.margin> | ||
<Insets bottom="25.0" left="10.0" right="10.0" /> | ||
</FlowPane.margin> | ||
</ImageView> | ||
|
||
<Text styleClass="home-heading" text="R" /> | ||
</FlowPane> | ||
<Text styleClass="home-heading" text="SWITCH" wrappingWidth="330.56640625" /> | ||
</VBox> | ||
|
||
<Pane fx:id="ballContainer" layoutX="367.0" layoutY="733.0" prefHeight="36.0" prefWidth="36.0"> | ||
<Pane fx:id="ball" prefHeight="110.0" prefWidth="36.0"> | ||
|
||
</Pane> | ||
</Pane> | ||
|
||
<Pane fx:id="csContainer" layoutX="367.0" layoutY="368.0" prefHeight="28.0" prefWidth="28.0"> | ||
<Pane fx:id="colourSwitcher" prefHeight="110.0" prefWidth="36.0"> | ||
|
||
</Pane> | ||
</Pane> | ||
|
||
<ImageView fitHeight="189.0" fitWidth="130.0" layoutX="354.0" layoutY="780.0" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="BOTTOM_CENTER"> | ||
<Image url="@../assets/game/tap.png" /> | ||
</ImageView> | ||
</Pane> | ||
</center> | ||
|
||
<top> | ||
<BorderPane> | ||
<left> | ||
<Pane layoutX="14.0" layoutY="14.0" prefHeight="101.0" prefWidth="94.0" styleClass="small-on-hover" AnchorPane.leftAnchor="40.0" AnchorPane.topAnchor="40.0" BorderPane.alignment="CENTER"> | ||
<cursor> | ||
<Cursor fx:constant="HAND" /> | ||
</cursor> | ||
<Circle fill="white" layoutX="48.0" layoutY="53.0" radius="43.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" AnchorPane.leftAnchor="19.0" AnchorPane.rightAnchor="19.0" BorderPane.alignment="CENTER"> | ||
<styleClass> | ||
<String fx:value="back-button" /> | ||
<String fx:value="fill-grey" /> | ||
</styleClass></Circle> | ||
<Text fx:id="score" fill="WHITE" layoutX="16.0" layoutY="66.0" text="0" textAlignment="CENTER" wrappingWidth="63.0" /> | ||
</Pane> | ||
</left> | ||
<right> | ||
<Pane layoutX="660.0" layoutY="14.0" onMouseClicked="#backToHome" prefHeight="101.0" prefWidth="94.0" styleClass="small-on-hover" AnchorPane.rightAnchor="40.0" AnchorPane.topAnchor="40.0" BorderPane.alignment="CENTER"> | ||
<cursor> | ||
<Cursor fx:constant="HAND" /> | ||
</cursor> | ||
<Circle layoutX="48.0" layoutY="53.0" radius="43.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" AnchorPane.leftAnchor="19.0" AnchorPane.rightAnchor="19.0" BorderPane.alignment="CENTER"> | ||
<styleClass> | ||
<String fx:value="back-button" /> | ||
<String fx:value="fill-grey" /> | ||
</styleClass></Circle> | ||
<ImageView fitHeight="54.0" fitWidth="59.0" layoutX="21.0" layoutY="26.0" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="BOTTOM_CENTER"> | ||
<Image url="@../assets/game/pause.png" /> | ||
</ImageView> | ||
</Pane> | ||
</right> | ||
<padding> | ||
<Insets left="25.0" right="25.0" top="25.0" /> | ||
</padding> | ||
</BorderPane> | ||
</top> | ||
|
||
<stylesheets> | ||
<URL value="@../style/style.css" /> | ||
</stylesheets> | ||
</BorderPane> |
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