├── .gitignore ├── ColorSwitch.pdf ├── LICENSE.md ├── README.md ├── UML ├── ClassDiagram_ColorSwitch.jpg └── UseCase_ColorSwitch.jpg ├── img_readme ├── Hi.gif ├── assets │ ├── colorCombinations │ │ ├── 1.jpg │ │ └── 2.jpg │ ├── gameOverPage │ │ ├── bg.png │ │ ├── colorCircleSmallWide.png │ │ ├── cursor.png │ │ ├── cursorBlocked.png │ │ ├── exit.png │ │ ├── headingWithoutRing.png │ │ ├── leaderboard.png │ │ ├── play.png │ │ ├── restart.png │ │ ├── star.png │ │ ├── star_black.png │ │ └── totalstars_white.png │ ├── gameplay │ │ ├── color_switcher.png │ │ ├── color_switcher_s.png │ │ ├── crown.png │ │ ├── crown_s.png │ │ ├── crown_w.png │ │ ├── hand.png │ │ ├── hand2.png │ │ ├── hand_s.png │ │ ├── pause.png │ │ └── star.png │ ├── inputPopup │ │ ├── cross.png │ │ ├── cursor.png │ │ ├── dist.png │ │ ├── dist_white.png │ │ ├── jump.png │ │ ├── jump_white.png │ │ └── star.png │ ├── lbPage │ │ ├── bg.png │ │ ├── bronze.png │ │ ├── crown.png │ │ ├── goBack.png │ │ ├── gold.png │ │ ├── silver.png │ │ └── star.png │ ├── loadAnimation │ │ ├── colorCircle.png │ │ ├── colorCircleSmallWide.png │ │ ├── headingWithoutRing.png │ │ └── ready.gif │ ├── loadGamePage │ │ ├── bg.png │ │ ├── cursor.png │ │ ├── cursorBlocked.png │ │ ├── goBack.png │ │ └── star.png │ ├── mainPage │ │ ├── bg.png │ │ ├── bubblebg.png │ │ ├── colorCircle.png │ │ ├── colorCircleSmallWide.png │ │ ├── cursor.png │ │ ├── exit.png │ │ ├── headingWithoutRing.png │ │ ├── leaderboard.png │ │ ├── load.png │ │ ├── logo.png │ │ ├── play.png │ │ ├── playDamped.png │ │ ├── settings.png │ │ ├── settings1.png │ │ ├── totalstars.png │ │ └── totalstars_white.png │ ├── music │ │ ├── bg │ │ │ ├── bg1.mp3 │ │ │ ├── bg2.mp3 │ │ │ ├── bg3.mp3 │ │ │ └── bg4.mp3 │ │ ├── buttons_audio_resource.png │ │ ├── effectsColorSwitch │ │ │ ├── achat.wav │ │ │ ├── breakball1.wav │ │ │ ├── button.wav │ │ │ ├── colorswitch.wav │ │ │ ├── dead.wav │ │ │ ├── deadclock.wav │ │ │ ├── error.wav │ │ │ ├── hover.wav │ │ │ ├── inprogress.wav │ │ │ ├── jump.wav │ │ │ ├── star.wav │ │ │ ├── start.wav │ │ │ ├── tapclock.wav │ │ │ ├── tic.wav │ │ │ ├── victory.wav │ │ │ └── wheel.wav │ │ ├── exit1.mp3 │ │ ├── exit2.mp3 │ │ ├── gameOver1.mp3 │ │ ├── gameOver2.mp3 │ │ ├── gameplay │ │ │ ├── bg1.mp3 │ │ │ ├── bg2.mp3 │ │ │ ├── bg3.mp3 │ │ │ ├── colorSwitch.wav │ │ │ ├── dead.wav │ │ │ ├── deadMeme.mp3 │ │ │ ├── dieFall.wav │ │ │ ├── jump.wav │ │ │ ├── star.mp3 │ │ │ └── star.wav │ │ ├── glow.mp3 │ │ └── mouse │ │ │ ├── button.wav │ │ │ ├── easterEgg_click0.wav │ │ │ ├── easterEgg_click1.mp3 │ │ │ ├── easterEgg_click2.mp3 │ │ │ ├── error.wav │ │ │ └── hover.wav │ ├── pauseOverlay │ │ ├── play.png │ │ ├── restart_white.png │ │ ├── returnToMain.png │ │ ├── save.png │ │ ├── save_black.png │ │ └── totalstars_white.png │ └── possibleBg │ │ ├── 1.jpg │ │ ├── 10.png │ │ ├── 11.png │ │ ├── 12.png │ │ ├── 13.png │ │ ├── 14.png │ │ ├── 15.png │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.png │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 6.png │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ ├── 9.png │ │ ├── bubblebg.png │ │ ├── bubblebg2.jpg │ │ ├── bubblebgResized.png │ │ ├── bubblebgResized1.png │ │ └── bubblebgResized2.png ├── bonus.jpg ├── snapshots.jpg └── sparkles.gif ├── misc_notes ├── Layout.txt └── Notes.md └── src ├── assets ├── colorCombinations │ ├── 1.jpg │ └── 2.jpg ├── gameOverPage │ ├── bg.png │ ├── colorCircleSmallWide.png │ ├── cursor.png │ ├── cursorBlocked.png │ ├── exit.png │ ├── headingWithoutRing.png │ ├── leaderboard.png │ ├── play.png │ ├── restart.png │ ├── star.png │ ├── star_black.png │ └── totalstars_white.png ├── gameplay │ ├── color_switcher.png │ ├── color_switcher_s.png │ ├── crown.png │ ├── crown_s.png │ ├── crown_w.png │ ├── hand.png │ ├── hand2.png │ ├── hand_s.png │ ├── pause.png │ └── star.png ├── inputPopup │ ├── cross.png │ ├── cursor.png │ ├── dist.png │ ├── dist_white.png │ ├── jump.png │ ├── jump_white.png │ └── star.png ├── lbPage │ ├── bg.png │ ├── bronze.png │ ├── crown.png │ ├── goBack.png │ ├── gold.png │ ├── silver.png │ └── star.png ├── loadAnimation │ ├── colorCircle.png │ ├── colorCircleSmallWide.png │ ├── headingWithoutRing.png │ └── ready.gif ├── loadGamePage │ ├── bg.png │ ├── cursor.png │ ├── cursorBlocked.png │ ├── goBack.png │ └── star.png ├── mainPage │ ├── bg.png │ ├── bubblebg.png │ ├── colorCircle.png │ ├── colorCircleSmallWide.png │ ├── cursor.png │ ├── exit.png │ ├── headingWithoutRing.png │ ├── leaderboard.png │ ├── load.png │ ├── logo.png │ ├── play.png │ ├── playDamped.png │ ├── settings.png │ ├── settings1.png │ ├── totalstars.png │ └── totalstars_white.png ├── music │ ├── bg │ │ ├── bg1.mp3 │ │ ├── bg2.mp3 │ │ ├── bg3.mp3 │ │ └── bg4.mp3 │ ├── buttons_audio_resource.png │ ├── effectsColorSwitch │ │ ├── achat.wav │ │ ├── breakball1.wav │ │ ├── button.wav │ │ ├── colorswitch.wav │ │ ├── dead.wav │ │ ├── deadclock.wav │ │ ├── error.wav │ │ ├── hover.wav │ │ ├── inprogress.wav │ │ ├── jump.wav │ │ ├── star.wav │ │ ├── start.wav │ │ ├── tapclock.wav │ │ ├── tic.wav │ │ ├── victory.wav │ │ └── wheel.wav │ ├── exit1.mp3 │ ├── exit2.mp3 │ ├── gameOver1.mp3 │ ├── gameOver2.mp3 │ ├── gameplay │ │ ├── bg1.mp3 │ │ ├── bg2.mp3 │ │ ├── bg3.mp3 │ │ ├── colorSwitch.wav │ │ ├── dead.wav │ │ ├── deadMeme.mp3 │ │ ├── dieFall.wav │ │ ├── jump.wav │ │ ├── star.mp3 │ │ └── star.wav │ ├── glow.mp3 │ └── mouse │ │ ├── button.wav │ │ ├── easterEgg_click0.wav │ │ ├── easterEgg_click1.mp3 │ │ ├── easterEgg_click2.mp3 │ │ ├── error.wav │ │ └── hover.wav ├── pauseOverlay │ ├── play.png │ ├── restart_white.png │ ├── returnToMain.png │ ├── save.png │ ├── save_black.png │ └── totalstars_white.png └── possibleBg │ ├── 1.jpg │ ├── 10.png │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.png │ ├── 5.jpg │ ├── 6.jpg │ ├── 6.png │ ├── 7.jpg │ ├── 8.jpg │ ├── 9.png │ ├── bubblebg.png │ ├── bubblebg2.jpg │ ├── bubblebgResized.png │ ├── bubblebgResized1.png │ └── bubblebgResized2.png ├── data ├── dataGame.ser ├── dataPlayer.ser └── dataTotalStars.ser ├── gameEngine ├── App.java ├── Ball.java ├── Game.java ├── GamePlay.java ├── ObstacleFactory.java ├── Player.java ├── bubbles │ ├── Bubble.java │ └── Bubbles.java ├── customExceptions │ ├── FallOutException.java │ ├── GameOverException.java │ ├── InsufficientStarsException.java │ └── ObstacleCollisionException.java ├── gameElements │ ├── GameElement.java │ ├── HighScoreLine.java │ ├── Star.java │ ├── SwitchColor.java │ └── obstacles │ │ ├── ObsCircle.java │ │ ├── ObsCircleTriangle.java │ │ ├── ObsConsecutiveCircles.java │ │ ├── ObsDoubleCircle.java │ │ ├── ObsLine.java │ │ ├── ObsOscillatingCircle.java │ │ ├── ObsOscillatingSquare.java │ │ ├── ObsSquare.java │ │ ├── ObsSquareCircle.java │ │ ├── ObsTriangle.java │ │ ├── ObsTripleCircle.java │ │ └── Obstacle.java ├── swarm │ ├── Particle.java │ └── Swarm.java └── util │ ├── Database.java │ ├── Pair.java │ └── Renderer.java └── gui ├── Dialog.fxml ├── Dialog.java ├── GameOverPage.fxml ├── GameOverPageController.java ├── GamePlay.fxml ├── GamePlayController.java ├── InputPopup.fxml ├── InputPopupController.java ├── LBPage.fxml ├── LBPageController.java ├── LoadAnimation.fxml ├── LoadAnimationController.java ├── LoadGamePage.fxml ├── LoadGamePageController.java ├── MainPage.fxml ├── MainPageController.java ├── PauseOverlay.fxml └── PauseOverlayController.java /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /ColorSwitch.iml 3 | /out/ 4 | -------------------------------------------------------------------------------- /ColorSwitch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/ColorSwitch.pdf -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Team-60 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |

3 | Color Switch 4 | 5 |

6 |

7 | A revamped game replica made by Divyansh Rastogi & Rupanshu Yadav 8 |

9 | 10 | 🔎   [Implementation Description](https://github.com/Team-60/ColorSwitch/blob/master/README.md#-----zap-implementation-description--) **/** 11 | [Game Objective](https://github.com/Team-60/ColorSwitch/blob/master/README.md#------book-game-objective---) **/** 12 | [How To Run?](https://github.com/Team-60/ColorSwitch/blob/master/README.md#------rocket-how-to-run----) **/** 13 | [In-Game Snapshots](https://github.com/Team-60/ColorSwitch/blob/master/README.md#------stars-in-game-snapshots--) **/** 14 | [Bonus Features](https://github.com/Team-60/ColorSwitch/blob/master/README.md#------sparkles-bonus-features----) 15 |
16 | 17 | #### 🎮   *Check out the gameplay [here](https://bit.ly/3bgOxZk)!* [**](https://github.com/Team-60/ColorSwitch#---the-video-might-be-laggy-due-to-quality-screen-recording-causing-heavy-load-----for-experiencing-a-super-smooth-gameplay-experience-install--run-the-game-) 18 | 19 |

20 | 21 | :zap: Implementation Description 22 | 23 |

24 |
For a further detailed overview, refer here :mag:
25 |

26 |   The UI/UX for the game is designed with JavaFX.
27 |   Implemented our own game-engine in JavaFx on bare canvas with 28 | optimized game-play physics offering ultra smooth rendering.
29 |   Utilized FXML and JavaFx CSS to tailor a receptive game interface designed on Scene Builder. 30 |

31 |
32 | 33 |

34 | 35 | :book: Game Objective 36 | 37 |

38 |
Learn more here :grey_exclamation:
39 |

40 | 41 | 42 | Encounter and pave your way through a variety of unique & challenging tri/quad-colored obstacles!
43 | All seems fun & enticing but this may very well change when you escort a colored ball through these shapes!
44 | Keep bouncing, have fun and good luck! 45 |

46 |
47 | 48 |

49 | 50 | :rocket: How to Run? 51 | 52 |

53 |
Current steps are supported on IntelliJ IDEA :exclamation:
54 | 55 | ### :gear: Dependencies: 56 |     JDK 11 or higher   |   [___download___](https://www.oracle.com/in/java/technologies/javase-jdk15-downloads.html)
57 |     JavaFX 11.0.1 or higher   |   [___download___](https://gluonhq.com/products/javafx/)
58 |     Git   |   [___download___](https://git-scm.com/downloads)
59 | 60 | ### :wrench: Setting up IntelliJ IDEA: 61 |     Install IntelliJ IDEA and follow basic setup guidelines
62 |     Open a new project from ___existing source___, use ``` https://github.com/Team-60/ColorSwitch.git ``` as project source.
63 |     Set up project libraries for JavaFX
64 |       Go to ``` File > Project Structure > Project Settings > Libraries ```
      Select ``` add a new Java library (+ icon) > select path to your JavaFx > "lib" folder```
65 |     Adding VM options for run configurations
66 |       Go under ``` Run > Edit Configurations ```
67 |       Add the following under *VM Options*
68 |       ```-ea --module-path "$JAVAFX_LIB_PATH" --add-modules javafx.controls,javafx.fxml,javafx.media```
69 |     Build the project :hammer:
70 |     Go to ``` src/gameEngine/App.java ``` , select the file and press ``` right click > run ```
71 | 72 |
73 |

74 | 75 | :stars: In-Game Snapshots 76 | 77 |

78 | 79 |
80 | 81 |

82 | 83 | :sparkles: Bonus Features 84 | 85 |

86 | 87 |
88 | 89 |

:thought_balloon:

90 |
If you wish to delve further into source code's layout and notes/observations compiled over various phases of the project,
feel free to check the same out here!
91 |
92 | 93 |

:construction: Work In Progress :construction:

94 |
95 | 96 |

97 |
98 | All contributions are welcomed!
99 | Drop a ⭐ if you found the project to be entertaining/helpful!

100 |
101 | 102 |
103 | ** The video might be laggy due to quality screen recording causing heavy load 😖
104 |   For experiencing a super smooth gameplay experience, install & run the game! 105 |
106 | -------------------------------------------------------------------------------- /UML/ClassDiagram_ColorSwitch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/UML/ClassDiagram_ColorSwitch.jpg -------------------------------------------------------------------------------- /UML/UseCase_ColorSwitch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/UML/UseCase_ColorSwitch.jpg -------------------------------------------------------------------------------- /img_readme/Hi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/Hi.gif -------------------------------------------------------------------------------- /img_readme/assets/colorCombinations/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/colorCombinations/1.jpg -------------------------------------------------------------------------------- /img_readme/assets/colorCombinations/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/colorCombinations/2.jpg -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/bg.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/colorCircleSmallWide.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/cursor.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/cursorBlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/cursorBlocked.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/exit.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/headingWithoutRing.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/leaderboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/leaderboard.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/play.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/restart.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/star.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/star_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/star_black.png -------------------------------------------------------------------------------- /img_readme/assets/gameOverPage/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameOverPage/totalstars_white.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/color_switcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/color_switcher.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/color_switcher_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/color_switcher_s.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/crown.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/crown_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/crown_s.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/crown_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/crown_w.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/hand.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/hand2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/hand2.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/hand_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/hand_s.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/pause.png -------------------------------------------------------------------------------- /img_readme/assets/gameplay/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/gameplay/star.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/cross.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/cursor.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/dist.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/dist_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/dist_white.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/jump.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/jump_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/jump_white.png -------------------------------------------------------------------------------- /img_readme/assets/inputPopup/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/inputPopup/star.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/bg.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/bronze.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/crown.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/goBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/goBack.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/gold.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/silver.png -------------------------------------------------------------------------------- /img_readme/assets/lbPage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/lbPage/star.png -------------------------------------------------------------------------------- /img_readme/assets/loadAnimation/colorCircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadAnimation/colorCircle.png -------------------------------------------------------------------------------- /img_readme/assets/loadAnimation/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadAnimation/colorCircleSmallWide.png -------------------------------------------------------------------------------- /img_readme/assets/loadAnimation/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadAnimation/headingWithoutRing.png -------------------------------------------------------------------------------- /img_readme/assets/loadAnimation/ready.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadAnimation/ready.gif -------------------------------------------------------------------------------- /img_readme/assets/loadGamePage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadGamePage/bg.png -------------------------------------------------------------------------------- /img_readme/assets/loadGamePage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadGamePage/cursor.png -------------------------------------------------------------------------------- /img_readme/assets/loadGamePage/cursorBlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadGamePage/cursorBlocked.png -------------------------------------------------------------------------------- /img_readme/assets/loadGamePage/goBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadGamePage/goBack.png -------------------------------------------------------------------------------- /img_readme/assets/loadGamePage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/loadGamePage/star.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/bg.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/bubblebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/bubblebg.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/colorCircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/colorCircle.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/colorCircleSmallWide.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/cursor.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/exit.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/headingWithoutRing.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/leaderboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/leaderboard.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/load.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/logo.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/play.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/playDamped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/playDamped.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/settings.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/settings1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/settings1.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/totalstars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/totalstars.png -------------------------------------------------------------------------------- /img_readme/assets/mainPage/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/mainPage/totalstars_white.png -------------------------------------------------------------------------------- /img_readme/assets/music/bg/bg1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/bg/bg1.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/bg/bg2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/bg/bg2.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/bg/bg3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/bg/bg3.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/bg/bg4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/bg/bg4.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/buttons_audio_resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/buttons_audio_resource.png -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/achat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/achat.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/breakball1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/breakball1.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/button.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/button.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/colorswitch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/colorswitch.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/dead.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/dead.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/deadclock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/deadclock.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/error.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/hover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/hover.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/inprogress.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/inprogress.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/jump.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/star.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/star.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/start.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/tapclock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/tapclock.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/tic.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/tic.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/victory.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/victory.wav -------------------------------------------------------------------------------- /img_readme/assets/music/effectsColorSwitch/wheel.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/effectsColorSwitch/wheel.wav -------------------------------------------------------------------------------- /img_readme/assets/music/exit1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/exit1.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/exit2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/exit2.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameOver1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameOver1.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameOver2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameOver2.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/bg1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/bg1.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/bg2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/bg2.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/bg3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/bg3.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/colorSwitch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/colorSwitch.wav -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/dead.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/dead.wav -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/deadMeme.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/deadMeme.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/dieFall.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/dieFall.wav -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/jump.wav -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/star.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/star.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/gameplay/star.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/gameplay/star.wav -------------------------------------------------------------------------------- /img_readme/assets/music/glow.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/glow.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/button.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/button.wav -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/easterEgg_click0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/easterEgg_click0.wav -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/easterEgg_click1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/easterEgg_click1.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/easterEgg_click2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/easterEgg_click2.mp3 -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/error.wav -------------------------------------------------------------------------------- /img_readme/assets/music/mouse/hover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/music/mouse/hover.wav -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/play.png -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/restart_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/restart_white.png -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/returnToMain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/returnToMain.png -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/save.png -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/save_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/save_black.png -------------------------------------------------------------------------------- /img_readme/assets/pauseOverlay/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/pauseOverlay/totalstars_white.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/1.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/10.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/11.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/12.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/13.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/14.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/15.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/2.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/3.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/4.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/5.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/6.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/6.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/7.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/8.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/9.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/bubblebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/bubblebg.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/bubblebg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/bubblebg2.jpg -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/bubblebgResized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/bubblebgResized.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/bubblebgResized1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/bubblebgResized1.png -------------------------------------------------------------------------------- /img_readme/assets/possibleBg/bubblebgResized2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/assets/possibleBg/bubblebgResized2.png -------------------------------------------------------------------------------- /img_readme/bonus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/bonus.jpg -------------------------------------------------------------------------------- /img_readme/snapshots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/snapshots.jpg -------------------------------------------------------------------------------- /img_readme/sparkles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/img_readme/sparkles.gif -------------------------------------------------------------------------------- /misc_notes/Layout.txt: -------------------------------------------------------------------------------- 1 | Class App (My main screen) [Controller] 2 | Fields: 3 | - Database 4 | - Database 5 | - highscore (-1 for first ever game) 6 | Added Height & Width 7 | Functions: 8 | - addAssets() { return void; } 9 | - formDatabase() { return void; } 10 | - newGame() { return Game; } (will be called be AppController which will transfer Game's instance to GamePlayController) 11 | - loadGame(int PlayerId) { return Game; } (Similar to new Game : notice one player can only have one loadGame) 12 | - restartGame() { return Game; } (refresh all states except the player's info) 13 | - leaderBoard() { return Database; } (will only be accessed by leaderBoardController) 14 | - removeGame(Game g) {from database based on if game is finished} 15 | - exit() { return void } (perform all cleanUp operations and exit the Application) 16 | getter/setter highscore 17 | + giveId() 18 | Exceptions: 19 | Extends: 20 | Implements: 21 | 22 | # implements loadable, comparable (need getters for file_path, save position in game) 23 | Class Database (Load game screen / Leaderboard in show) 24 | Fields: 25 | - MAX_SIZE (Overriding param) 26 | - data ArrayList 27 | Functions: 28 | // I am not sure about these functions yet 29 | // depends on how you if we are using instanceOf or getting value using getter 30 | + form(String filePath) : void 31 | + retrieveData() : ArrayList 32 | + update(T , pos) : void (can use instanceOf here) 33 | Exceptions: 34 | Exception (IO / ClassNotFound / ClassCast) 35 | Extends: 36 | Implements: 37 | 38 | # adding equals based on id of players, added destroyed parameter, and compareTo & the save slot (getters setters accordingly) 39 | Class Game: 40 | Fields: 41 | - App (Binary Association) (Stronger form of dependency) 42 | - Player (Keep Info) (Player and game elements interact through ball) (Association) (As a constructor param) 43 | - Game Elements 44 | - ball 45 | + FILE_PATH (static final) 46 | + MID_LINE (static final) 47 | + STARS_RESTART (static final) 48 | - NUM_ELEMENTS (number of elements to spawn) (static final) 49 | Functions: 50 | + refreshGameElements() { return void; } (ensure proper pairings between stars / obstacles / switches) (discard) (reflectChanges in gui counterpart) 51 | - moveScreenRelative() (apply offset) { return void; } 52 | + registerJump() { return void; } (changes ball velocity) 53 | + checkAndUpdate() { return void; } (checks for interaction & score update & move screens) 54 | + pause() { return void; } (write into file) ? // can be avoided depends on our implementation of Game 55 | + resume() { return void; } (read from file) ? // can be avoided depends on our implementation of Game 56 | + save() { return void; } (write to load file) 57 | + getApp() {return App; } 58 | + getPlayer() {return Player; } 59 | + setApp(App) {return void; } 60 | Exceptions: 61 | ObstacleCollision 62 | FellDown 63 | NotEnoughStarsForRestart 64 | Extends: 65 | Implements: 66 | Serializable, Comparable 67 | 68 | Class Player: 69 | Fields: 70 | - name // it is necessary ? 71 | - id 72 | - score 73 | + FILE_PATH (static final) 74 | Functions: 75 | getter/setters 76 | + incrementScore() { return void; } 77 | + compareTo(Player) { return int; } 78 | getters/setters for score, id, name 79 | Exceptions: 80 | Extends: 81 | Implements: 82 | Serializable, Comparable 83 | 84 | added getColor, setColor 85 | Class Ball: 86 | Fields: 87 | - x (static) 88 | - y 89 | - radius (static) 90 | - color 91 | - velocity 92 | - gravity (final static) 93 | - jumpSpeed (final static) 94 | - Circle sprite 95 | Functions: 96 | + jump() { return void; } // just sets velocity to jumpSpeed 97 | + move() { return int; } // returns the offset 98 | + refresh() { return void; } 99 | + destroy(Pane p) {return void; } ? 100 | + checkFall() { return Boolean; } 101 | getx, gety 102 | Exceptions: 103 | Extends: 104 | Implements: 105 | Serializable 106 | 107 | Class GameElements: (Abstract) 108 | Fields: 109 | - x 110 | - y 111 | - closestSafeDist 112 | Functions: 113 | constructor 114 | + applyOffset (int offset) { return void; } 115 | + spawn(Pane pane) { return void; } (Abstract) 116 | + refresh() { return void; } (Abstract) 117 | + checkCollision(Ball ball) { return Boolean; } (Abstract) 118 | + destroy(Pane p) { return void; } (Abstract) 119 | + getClosestSafeDist() { return int; } 120 | Exceptions: 121 | Extends: 122 | Implements: 123 | Serializable 124 | 125 | Class Star: 126 | Fields: 127 | closestSafeDist static 128 | points static 129 | // will also contain GUI components but not sure what 130 | Functions: 131 | Overriding Abstract Methods 132 | Exceptions: 133 | Extends: 134 | GameElements 135 | Implements: 136 | 137 | Class SwitchColor: 138 | Fields: 139 | closestSafeDist static 140 | predefined color 141 | // will also contain GUI components but not sure what 142 | Functions: 143 | Overriding Abstract Methods 144 | getColor 145 | Exceptions: 146 | Extends: 147 | GameElements 148 | Implements: 149 | 150 | Class Obstacle: (Abstract) 151 | Fields: 152 | translation speed 153 | rotation speed 154 | Functions: 155 | Implementing Abstract 156 | Exceptions: 157 | Extends: 158 | GameElements 159 | Implements: 160 | 161 | # Constructors for each class below, Double constructors in case of inheritance 162 | Class ObsCircle: 163 | Fields: 164 | closestSafeDist static 165 | // will also contain GUI components but not sure what 166 | # radius 167 | Functions: 168 | spawn 169 | + refresh 170 | checkCollision 171 | + destroy 172 | Exceptions: 173 | Extends: 174 | Obstacle 175 | Implements: 176 | 177 | Class ObsDoubleCircle: 178 | Fields: 179 | # radiusOut 180 | // will also contain GUI components but not sure what 181 | Functions: (Override) 182 | spawn 183 | + refresh 184 | checkCollision 185 | + destroy 186 | Exceptions: 187 | Extends: 188 | ObsCircle 189 | Implements: 190 | 191 | Class ObsLine: 192 | Fields: 193 | closestSafeDist static 194 | width 195 | height 196 | // will also contain GUI components but not sure what 197 | Functions: 198 | spawn 199 | + refresh 200 | checkCollision 201 | + destroy 202 | Exceptions: 203 | Extends: 204 | Obstacle 205 | Implements: 206 | 207 | Class ObsDoubleLine: 208 | Fields: 209 | closestSafeDist static 210 | width 211 | height 212 | // will also contain GUI components but not sure what 213 | Functions: 214 | spawn 215 | + refresh 216 | checkCollision 217 | + destroy 218 | Exceptions: 219 | Extends: 220 | ObsLine 221 | Implements: 222 | 223 | Class ObsSquare: 224 | Fields: 225 | closestSafeDist static 226 | // will also contain GUI components but not sure what 227 | Functions: 228 | spawn 229 | + refresh 230 | checkCollision 231 | + destroy 232 | Exceptions: 233 | Extends: 234 | Obstacle 235 | Implements: 236 | 237 | Custom Exceptions: 238 | - Collision 239 | - Fell Down 240 | - Not enough stars for restart -------------------------------------------------------------------------------- /misc_notes/Notes.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | 3 | ## Bonus Ideas 4 | - Settings, play music, night mode, reset database, rules and creds 5 | - Leaderboard 6 | - Supercharge, obstacle blast, high frequency sound ?? (better with sideline collection of balls) 7 | - https://stackoverflow.com/questions/31866814/javafx-multithreading-flashing-lights effects ?? 8 | - Maybe rotation of obst. as game? Add settings? 9 | - game mode custom powerups :- revive, extra stars, boost, immunity, 2x, 1/2x 10 | - game mode - firefly, launch, the floor is lava 11 | 12 | 13 | ## Ideas 14 | - ~~Obstacle, Star, SwitchColor inheriting abstract GameElements~~ 15 | - ~~ObstacleTypes inheriting abstract Obstacle~~ 16 | - ~~GameElements, CheckCollision, Action, Offset~~ 17 | - ~~Generic could be implemented for game screens, Main game screen, Load game~~ 18 | - ~~Layout with fxml, transitions through changing scenes~~ 19 | - ~~Classes like Main Game screen and Load game not necessary and can be implemented better with fxml, instead things like Database would be a good idea~~ 20 | - ~~A class with its controller methods are intertwined, load corresponding fxml in class and handle in controller~~ 21 | - Maintain midLine, highScoreLine 22 | - Generic classes for Database, as Database for games for load screens, Database of Players for leaderboard. 23 | - ? Ball within Game instead of Player to side-line game info with details 24 | - ~~Controller interacts with other *controllers and fxml* but only interacts with logic of it's superceding class~~ 25 | - ~~Could use the concept of __flags__ to communicate between logic and controller~~ 26 | - Cloning in Player, Database as immutable generic class 27 | - **IMP** May need to create destroy function for game, (see if instance is garbage collected) 28 | - **IMP** No one is holding an instance of GamePlay which creates new game 29 | - Controllers could be viewed as data and game state passing utilities. 30 | - **IMP** add '-ea' VM option for assert 31 | - **IMP** always init controllers before transitions, may throw intermediate exceptions 32 | - For other game mode, firefly, just add a separate screen to rootContainer, need a different leaderboard, see for assertions, save slots remain same, need to add distinction via. variable 33 | - Revival is for the same player, overwriteGame modified in order to suit saving methods, cannot be revived twice 34 | 35 | ## Misc 36 | - Threading (**IMP. FOR BETTER PERFORMANCE** [here](https://www.developer.com/java/data/multithreading-in-javafx.html)) 37 | - ~~Transitions could be done via Scene replacement in a single stage~~ 38 | - ~~maintain .gitignore~~ 39 | - Load games via creating overridden constructors 40 | - ~~? Loading fxml while creation~~ 41 | - Every Loading and Saving would be treated as new player creation but with same parameters (Leaderboard) 42 | 43 | ## Classes 44 | * ~~MainPage : New Game, Load Game, Exit Game~~ 45 | * ~~LoadGamePage ?~~ 46 | * Game 47 | * GameElements (Interface / Class) ? 48 | * Ball 49 | * Obstacle 50 | * Star 51 | * SwitchColor 52 | * ~~PauseGamePage ?~~ 53 | * ~~EndGamePage ?~~ 54 | * LeaderBoard 55 | 56 | ## TODO 57 | * ~~Understand code workflow (b)~~ 58 | * ~~Exceptions / Interfaces / Generic~~ 59 | * ~~Ask bhavya/osheen on how to get gifs/assets~~ 60 | 61 | ### Resources 62 | - https://gist.github.com/Roland09/71ef45f14d0ec2a353e6 (Particle system) 63 | - https://github.com/crt09/Color-Switch (assets) 64 | 65 | ### Exceptions 66 | - Collision 67 | - Fell Down 68 | - Not enough stars for restart 69 | - Std. IO/Class Not Found/ 70 | 71 | ### UML & USE CASE notes 72 | - ~~Add constructors~~ 73 | - ~~Add sorting for players~~ 74 | - ~~Add actor for enter name ?~~ 75 | - ~~what are extension points ?~~ 76 | - ~~Can generalize interact with obstacle ?~~ 77 | 78 | ## Resources Deadline 2 79 | - Color Combination https://designschool.canva.com/wp-content/uploads/sites/2/2016/01/100_Brilliant_Color_combinations_Updated1.pdf 80 | 81 | ## Notes gui: 82 | - Pref width 450, height 700 83 | - Color Yellow: F6DF0E Purple: 8E11FE Blue: 32E1F4 Pink: FD0082 84 | - keep in mind, referencing of loaders & objects 85 | - Line is fkd, sometimes it passes through wrong colors and when ball falls down on the line, it doesn't collide 86 | - on Collision with obstacle, first stop bg music and then play music 87 | - For all screen interchanges, assert root container size 88 | - In leaderboard for custom sorting, can easily be implemented (use text only), a button for the same -------------------------------------------------------------------------------- /src/assets/colorCombinations/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/colorCombinations/1.jpg -------------------------------------------------------------------------------- /src/assets/colorCombinations/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/colorCombinations/2.jpg -------------------------------------------------------------------------------- /src/assets/gameOverPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/bg.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/colorCircleSmallWide.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/cursor.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/cursorBlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/cursorBlocked.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/exit.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/headingWithoutRing.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/leaderboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/leaderboard.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/play.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/restart.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/star.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/star_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/star_black.png -------------------------------------------------------------------------------- /src/assets/gameOverPage/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameOverPage/totalstars_white.png -------------------------------------------------------------------------------- /src/assets/gameplay/color_switcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/color_switcher.png -------------------------------------------------------------------------------- /src/assets/gameplay/color_switcher_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/color_switcher_s.png -------------------------------------------------------------------------------- /src/assets/gameplay/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/crown.png -------------------------------------------------------------------------------- /src/assets/gameplay/crown_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/crown_s.png -------------------------------------------------------------------------------- /src/assets/gameplay/crown_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/crown_w.png -------------------------------------------------------------------------------- /src/assets/gameplay/hand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/hand.png -------------------------------------------------------------------------------- /src/assets/gameplay/hand2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/hand2.png -------------------------------------------------------------------------------- /src/assets/gameplay/hand_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/hand_s.png -------------------------------------------------------------------------------- /src/assets/gameplay/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/pause.png -------------------------------------------------------------------------------- /src/assets/gameplay/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/gameplay/star.png -------------------------------------------------------------------------------- /src/assets/inputPopup/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/cross.png -------------------------------------------------------------------------------- /src/assets/inputPopup/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/cursor.png -------------------------------------------------------------------------------- /src/assets/inputPopup/dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/dist.png -------------------------------------------------------------------------------- /src/assets/inputPopup/dist_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/dist_white.png -------------------------------------------------------------------------------- /src/assets/inputPopup/jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/jump.png -------------------------------------------------------------------------------- /src/assets/inputPopup/jump_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/jump_white.png -------------------------------------------------------------------------------- /src/assets/inputPopup/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/inputPopup/star.png -------------------------------------------------------------------------------- /src/assets/lbPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/bg.png -------------------------------------------------------------------------------- /src/assets/lbPage/bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/bronze.png -------------------------------------------------------------------------------- /src/assets/lbPage/crown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/crown.png -------------------------------------------------------------------------------- /src/assets/lbPage/goBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/goBack.png -------------------------------------------------------------------------------- /src/assets/lbPage/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/gold.png -------------------------------------------------------------------------------- /src/assets/lbPage/silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/silver.png -------------------------------------------------------------------------------- /src/assets/lbPage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/lbPage/star.png -------------------------------------------------------------------------------- /src/assets/loadAnimation/colorCircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadAnimation/colorCircle.png -------------------------------------------------------------------------------- /src/assets/loadAnimation/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadAnimation/colorCircleSmallWide.png -------------------------------------------------------------------------------- /src/assets/loadAnimation/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadAnimation/headingWithoutRing.png -------------------------------------------------------------------------------- /src/assets/loadAnimation/ready.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadAnimation/ready.gif -------------------------------------------------------------------------------- /src/assets/loadGamePage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadGamePage/bg.png -------------------------------------------------------------------------------- /src/assets/loadGamePage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadGamePage/cursor.png -------------------------------------------------------------------------------- /src/assets/loadGamePage/cursorBlocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadGamePage/cursorBlocked.png -------------------------------------------------------------------------------- /src/assets/loadGamePage/goBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadGamePage/goBack.png -------------------------------------------------------------------------------- /src/assets/loadGamePage/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/loadGamePage/star.png -------------------------------------------------------------------------------- /src/assets/mainPage/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/bg.png -------------------------------------------------------------------------------- /src/assets/mainPage/bubblebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/bubblebg.png -------------------------------------------------------------------------------- /src/assets/mainPage/colorCircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/colorCircle.png -------------------------------------------------------------------------------- /src/assets/mainPage/colorCircleSmallWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/colorCircleSmallWide.png -------------------------------------------------------------------------------- /src/assets/mainPage/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/cursor.png -------------------------------------------------------------------------------- /src/assets/mainPage/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/exit.png -------------------------------------------------------------------------------- /src/assets/mainPage/headingWithoutRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/headingWithoutRing.png -------------------------------------------------------------------------------- /src/assets/mainPage/leaderboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/leaderboard.png -------------------------------------------------------------------------------- /src/assets/mainPage/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/load.png -------------------------------------------------------------------------------- /src/assets/mainPage/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/logo.png -------------------------------------------------------------------------------- /src/assets/mainPage/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/play.png -------------------------------------------------------------------------------- /src/assets/mainPage/playDamped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/playDamped.png -------------------------------------------------------------------------------- /src/assets/mainPage/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/settings.png -------------------------------------------------------------------------------- /src/assets/mainPage/settings1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/settings1.png -------------------------------------------------------------------------------- /src/assets/mainPage/totalstars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/totalstars.png -------------------------------------------------------------------------------- /src/assets/mainPage/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/mainPage/totalstars_white.png -------------------------------------------------------------------------------- /src/assets/music/bg/bg1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/bg/bg1.mp3 -------------------------------------------------------------------------------- /src/assets/music/bg/bg2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/bg/bg2.mp3 -------------------------------------------------------------------------------- /src/assets/music/bg/bg3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/bg/bg3.mp3 -------------------------------------------------------------------------------- /src/assets/music/bg/bg4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/bg/bg4.mp3 -------------------------------------------------------------------------------- /src/assets/music/buttons_audio_resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/buttons_audio_resource.png -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/achat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/achat.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/breakball1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/breakball1.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/button.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/button.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/colorswitch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/colorswitch.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/dead.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/dead.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/deadclock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/deadclock.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/error.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/hover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/hover.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/inprogress.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/inprogress.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/jump.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/star.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/star.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/start.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/tapclock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/tapclock.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/tic.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/tic.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/victory.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/victory.wav -------------------------------------------------------------------------------- /src/assets/music/effectsColorSwitch/wheel.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/effectsColorSwitch/wheel.wav -------------------------------------------------------------------------------- /src/assets/music/exit1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/exit1.mp3 -------------------------------------------------------------------------------- /src/assets/music/exit2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/exit2.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameOver1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameOver1.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameOver2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameOver2.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/bg1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/bg1.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/bg2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/bg2.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/bg3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/bg3.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/colorSwitch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/colorSwitch.wav -------------------------------------------------------------------------------- /src/assets/music/gameplay/dead.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/dead.wav -------------------------------------------------------------------------------- /src/assets/music/gameplay/deadMeme.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/deadMeme.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/dieFall.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/dieFall.wav -------------------------------------------------------------------------------- /src/assets/music/gameplay/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/jump.wav -------------------------------------------------------------------------------- /src/assets/music/gameplay/star.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/star.mp3 -------------------------------------------------------------------------------- /src/assets/music/gameplay/star.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/gameplay/star.wav -------------------------------------------------------------------------------- /src/assets/music/glow.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/glow.mp3 -------------------------------------------------------------------------------- /src/assets/music/mouse/button.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/button.wav -------------------------------------------------------------------------------- /src/assets/music/mouse/easterEgg_click0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/easterEgg_click0.wav -------------------------------------------------------------------------------- /src/assets/music/mouse/easterEgg_click1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/easterEgg_click1.mp3 -------------------------------------------------------------------------------- /src/assets/music/mouse/easterEgg_click2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/easterEgg_click2.mp3 -------------------------------------------------------------------------------- /src/assets/music/mouse/error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/error.wav -------------------------------------------------------------------------------- /src/assets/music/mouse/hover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/music/mouse/hover.wav -------------------------------------------------------------------------------- /src/assets/pauseOverlay/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/play.png -------------------------------------------------------------------------------- /src/assets/pauseOverlay/restart_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/restart_white.png -------------------------------------------------------------------------------- /src/assets/pauseOverlay/returnToMain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/returnToMain.png -------------------------------------------------------------------------------- /src/assets/pauseOverlay/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/save.png -------------------------------------------------------------------------------- /src/assets/pauseOverlay/save_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/save_black.png -------------------------------------------------------------------------------- /src/assets/pauseOverlay/totalstars_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/pauseOverlay/totalstars_white.png -------------------------------------------------------------------------------- /src/assets/possibleBg/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/1.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/10.png -------------------------------------------------------------------------------- /src/assets/possibleBg/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/11.png -------------------------------------------------------------------------------- /src/assets/possibleBg/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/12.png -------------------------------------------------------------------------------- /src/assets/possibleBg/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/13.png -------------------------------------------------------------------------------- /src/assets/possibleBg/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/14.png -------------------------------------------------------------------------------- /src/assets/possibleBg/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/15.png -------------------------------------------------------------------------------- /src/assets/possibleBg/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/2.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/3.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/4.png -------------------------------------------------------------------------------- /src/assets/possibleBg/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/5.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/6.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/6.png -------------------------------------------------------------------------------- /src/assets/possibleBg/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/7.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/8.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/9.png -------------------------------------------------------------------------------- /src/assets/possibleBg/bubblebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/bubblebg.png -------------------------------------------------------------------------------- /src/assets/possibleBg/bubblebg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/bubblebg2.jpg -------------------------------------------------------------------------------- /src/assets/possibleBg/bubblebgResized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/bubblebgResized.png -------------------------------------------------------------------------------- /src/assets/possibleBg/bubblebgResized1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/bubblebgResized1.png -------------------------------------------------------------------------------- /src/assets/possibleBg/bubblebgResized2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/assets/possibleBg/bubblebgResized2.png -------------------------------------------------------------------------------- /src/data/dataGame.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/data/dataGame.ser -------------------------------------------------------------------------------- /src/data/dataPlayer.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Team-60/ColorSwitch/67a6e4162cd23f23d0543317f7c7e7428230746e/src/data/dataPlayer.ser -------------------------------------------------------------------------------- /src/data/dataTotalStars.ser: -------------------------------------------------------------------------------- 1 | . -------------------------------------------------------------------------------- /src/gameEngine/Ball.java: -------------------------------------------------------------------------------- 1 | package gameEngine; 2 | 3 | import javafx.scene.canvas.GraphicsContext; 4 | import javafx.scene.image.Image; 5 | import javafx.scene.media.AudioClip; 6 | import javafx.scene.paint.Color; 7 | 8 | import java.io.File; 9 | import java.io.Serializable; 10 | 11 | public class Ball implements Serializable { 12 | 13 | private static final long serialVersionUID = 2022L; 14 | 15 | private final double jumpSpeed = -450; 16 | private double gravity = 1500; 17 | private final double radius = 10; 18 | private final double x = 225; 19 | private final double midLine = 350; 20 | 21 | private double handPosition; 22 | private double y; 23 | private double velocity; // as velocity, will always start from 0 24 | private String color; 25 | 26 | private transient GraphicsContext graphicsContext; 27 | private static final Image hand = new Image(new File("src/assets/gameplay/hand_s.png").toURI().toString()); 28 | private static final AudioClip audioClip = new AudioClip(new File("src/assets/music/gameplay/jump.wav").toURI().toString()); 29 | 30 | Ball(GraphicsContext graphicsContext) { 31 | y = 600; 32 | velocity = 0; 33 | handPosition = 570; 34 | color = "000000"; 35 | this.graphicsContext = graphicsContext; 36 | } 37 | 38 | public void setY(double y) { 39 | this.y = y; 40 | } 41 | 42 | public void setGraphicsContext(GraphicsContext _graphicsContext) { // after deserializing 43 | this.graphicsContext = _graphicsContext; 44 | } 45 | 46 | public void refresh() { 47 | graphicsContext.setFill(Color.web(color)); 48 | graphicsContext.fillOval(x - radius, y - radius, 2 * radius, 2 * radius); 49 | if (handPosition < 900) { 50 | graphicsContext.drawImage(hand, x - 17, handPosition + 15); 51 | } 52 | } 53 | 54 | public void jump() { 55 | audioClip.play(); // TEMPORARY, TODO: MUSIC DISABLE 56 | velocity = jumpSpeed; 57 | } 58 | 59 | public double move(double time, Player player) { 60 | double distance = velocity * time + (gravity * time * time)/2; 61 | velocity += gravity * time; 62 | y += distance; 63 | player.incDist(Math.abs(distance)); // inc player distance 64 | 65 | if (y > handPosition) { 66 | y = handPosition; 67 | velocity = 0; 68 | } 69 | if (y < midLine) { 70 | double te = y; 71 | double offset = midLine - te; 72 | y = midLine + offset * 0.0; 73 | handPosition += offset; 74 | return offset * 1.0; 75 | } 76 | return 0; 77 | } 78 | 79 | public double getY() { 80 | return y; 81 | } 82 | 83 | public double getRadius() { 84 | return radius; 85 | } 86 | 87 | public String getColor() { 88 | return color; 89 | } 90 | 91 | public void setColor(String color) { 92 | this.color = color; 93 | } 94 | 95 | public double getX() { 96 | return x; 97 | } 98 | 99 | // in case to halt the gameplay 100 | public void resetGravity() { 101 | this.gravity = 1500; 102 | } 103 | 104 | public void removeGravity() { 105 | this.gravity = 0; 106 | } 107 | 108 | public double getVelocity() { 109 | return this.velocity; 110 | } 111 | 112 | public void setVelocity(double _velocity) { 113 | this.velocity = _velocity; 114 | } 115 | 116 | public void clipBall() { 117 | graphicsContext.moveTo(x, y); 118 | graphicsContext.arc(x, y, radius, radius, 0, 360); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/gameEngine/ObstacleFactory.java: -------------------------------------------------------------------------------- 1 | package gameEngine; 2 | 3 | import gameEngine.gameElements.obstacles.*; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Arrays; 7 | import java.util.Random; 8 | 9 | public class ObstacleFactory { 10 | 11 | public static Obstacle obstacle(int score, double x, double y) { 12 | int level = (score + 1) * 3; 13 | 14 | int difficulty; 15 | Random random = new Random(); 16 | if (level > 26) { 17 | level = 26; 18 | difficulty = -random.nextInt(15) + level; 19 | } else if (level > 3) { 20 | difficulty = -random.nextInt(5) + level; 21 | } else difficulty = random.nextInt(3) + 1; 22 | 23 | ArrayList hard = new ArrayList<>(Arrays.asList(17, 18, 19, 20, 21, 22, 23, 24, 25,26)); 24 | difficulty = hard.get(random.nextInt(hard.size())); 25 | 26 | System.out.println(ObstacleFactory.class.toString() + " difficulty: " + difficulty); 27 | Obstacle obstacle; 28 | 29 | switch (difficulty) { 30 | case 1: 31 | return (new ObsCircle(x, y - 90, 90, 15)); 32 | case 2: 33 | return new ObsDoubleCircle(x, y - 115, 90, 115, 15); 34 | case 3: 35 | // smaller square 36 | return new ObsSquare(x, y - 70 * Math.sqrt(2), 140, 13); 37 | case 4: 38 | return new ObsLine(x, y - 7.5, 15); 39 | case 5: 40 | return new ObsTriangle(x, y - 200 / Math.sqrt(3), 200, 15); 41 | case 6: 42 | // faster circle with same radius 43 | obstacle = new ObsCircle(x, y - 90, 90, 15); 44 | obstacle.setRotationalSpeed(150); 45 | return obstacle; 46 | case 7: 47 | // faster square with same size 48 | obstacle = new ObsSquare(x, y - 85 * Math.sqrt(2), 170, 15); 49 | obstacle.setRotationalSpeed(150); 50 | return obstacle; 51 | case 8: 52 | // faster double circle with same size 53 | obstacle = new ObsDoubleCircle(x, y - 115, 90, 115, 15); 54 | obstacle.setRotationalSpeed(150); 55 | return obstacle; 56 | case 9: 57 | // faster triangle with same size 58 | obstacle = new ObsTriangle(x, y - 200 / Math.sqrt(3), 200, 15); 59 | obstacle.setRotationalSpeed(130); 60 | return obstacle; 61 | case 10: 62 | // smaller circle 63 | return new ObsCircle(x, y - 75, 75, 10); 64 | case 11: 65 | // smaller double circle 66 | return new ObsDoubleCircle(x, y - 90, 70, 90, 13); 67 | case 12: 68 | ObsLine obsLine = new ObsLine(x, y - 7.5, 15); 69 | obsLine.setTranslationSpeed(150); 70 | return obsLine; 71 | case 13: 72 | // smaller triangle 73 | return new ObsTriangle(x, y - 190 / Math.sqrt(3), 190, 13); 74 | case 14: 75 | // super slow circle 76 | obstacle = new ObsCircle(x, y - 65, 65, 8); 77 | obstacle.setRotationalSpeed(50); 78 | return obstacle; 79 | case 15: 80 | ObsCircle circle = new ObsCircle(x, y - 90, 90, 15); 81 | return new ObsConsecutiveCircles(circle, 3); 82 | case 16: 83 | circle = new ObsCircle(x, y - 90, 90, 15); 84 | return new ObsConsecutiveCircles(circle, 4); 85 | case 17: 86 | return new ObsSquareCircle(x, y - 85 * Math.sqrt(2), 200, 15); 87 | case 18: 88 | // smaller consecutive 89 | circle = new ObsCircle(x, y - 75, 75, 10); 90 | return new ObsConsecutiveCircles(circle, 3); 91 | case 19: 92 | return new ObsCircleTriangle(x, y - 300 / Math.sqrt(3), 300, 15); 93 | case 20: 94 | ObsCircle doubleCircle = new ObsDoubleCircle(x, y - 115, 90, 115, 15); 95 | return new ObsConsecutiveCircles(doubleCircle, 3); 96 | case 21: 97 | ObsCircle obsTripleCircle = new ObsTripleCircle(x, y - 140, 90, 115, 140, 15); 98 | return new ObsConsecutiveCircles(obsTripleCircle, 3); 99 | case 22: 100 | // faster and smaller consecutive circle 101 | circle = new ObsCircle(x, y - 75, 75, 10); 102 | obstacle = new ObsConsecutiveCircles(circle, 4); 103 | obstacle.setRotationalSpeed(150); 104 | return obstacle; 105 | case 23: 106 | doubleCircle = new ObsDoubleCircle(x, y - 115, 90, 115, 15); 107 | return new ObsConsecutiveCircles(doubleCircle, 4); 108 | case 24: 109 | obstacle = new ObsOscillatingCircle(x, y - 90, 90, 15); 110 | return obstacle; 111 | case 25: 112 | obstacle = new ObsOscillatingSquare(x, y - 85 * Math.sqrt(2), 170, 15); 113 | return obstacle; 114 | default: 115 | obsTripleCircle = new ObsTripleCircle(x, y - 140, 90, 115, 140, 15); 116 | return new ObsConsecutiveCircles(obsTripleCircle, 5); 117 | } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /src/gameEngine/Player.java: -------------------------------------------------------------------------------- 1 | package gameEngine; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Player implements Serializable, Comparable { // info. keep 6 | 7 | private static final long serialVersionUID = 2023L; 8 | public static final String FILE_PATH = "src/data/dataPlayer.ser"; 9 | 10 | private String name; 11 | private int id; 12 | private int score; 13 | private int jumps; 14 | private double distance; 15 | private String date; 16 | private Boolean hasRevived; 17 | private int scoreBeforeRevival; 18 | private final boolean isClassicMode; 19 | 20 | public Player() { 21 | this.name = null; 22 | this.id = -1; 23 | this.score = 0; 24 | this.jumps = 0; 25 | this.distance = 0; 26 | this.date = null; 27 | this.hasRevived = false; 28 | this.scoreBeforeRevival = 0; // 0 in case no revival has happened 29 | this.isClassicMode = GamePlay.IS_CLASSIC; // as new player inherits current existing mode from GamePlay 30 | } 31 | 32 | public int getScore() { 33 | return score; 34 | } 35 | public String getDistance() { 36 | double fDist = this.distance/1000.0; 37 | String res = String.format("%.1f", fDist); 38 | return res + "k"; 39 | } // return formatted string 40 | public String getJumps() { 41 | int fJumps = this.jumps; 42 | return (fJumps >= 1000) ? (String.format("%.1f", fJumps / 1000.0) + "k") : Integer.toString(fJumps); 43 | } 44 | public int getNJumps() { 45 | return this.jumps; 46 | } 47 | public double getNDistance() { 48 | return this.distance; 49 | } 50 | public int getId() { 51 | return id; 52 | } 53 | public String getName() { 54 | return this.name; 55 | } 56 | public String getDate() { 57 | return this.date; 58 | } 59 | public boolean getHasRevived() { 60 | return this.hasRevived; 61 | } 62 | public int getScoreBeforeRevival() { 63 | return this.scoreBeforeRevival; 64 | } 65 | public boolean getIsClassicMode() { 66 | return this.isClassicMode; 67 | } 68 | 69 | public void setId(int _id) { 70 | this.id = _id; 71 | } 72 | public void setScore(int score) { 73 | this.score = score; 74 | } 75 | public void incScore() { 76 | this.score ++; 77 | } 78 | public void incJumps() { 79 | this.jumps ++; 80 | } 81 | public void incDist(double dist) { 82 | this.distance += dist; 83 | } 84 | public void setDate(String _date) { 85 | this.date = _date; 86 | } 87 | public void setName(String name) { 88 | this.name = name; 89 | } 90 | public void setHasRevived() { 91 | assert (!this.hasRevived); 92 | this.hasRevived = true; 93 | } 94 | public void setScoreBeforeRevival() { 95 | assert (this.hasRevived); 96 | this.scoreBeforeRevival = this.score; 97 | } 98 | 99 | @Override 100 | public int compareTo(Player p) { // for leaderboard 101 | int sc = Integer.compare(p.getScore(), this.score); 102 | int jc = Integer.compare(this.getNJumps(), p.getNJumps()); 103 | int dc = Double.compare(this.getNDistance(), p.getNDistance()); 104 | if (sc == 0) 105 | if (jc == 0) return dc; 106 | else return jc; 107 | else return sc; 108 | } 109 | 110 | @Override 111 | public boolean equals(Object p) { 112 | if (p.getClass() != this.getClass()) 113 | return false; 114 | Player temp = (Player) p; 115 | if (this.id == -1) return false; // unidentified player 116 | return temp.getId() == this.id; 117 | } 118 | 119 | @Override 120 | public String toString() { 121 | String ms = "* Mode: " + (this.isClassicMode ? "Classic\n" : "Bubbles\n"); 122 | String ps = "* Name: " + this.name + "\n"; 123 | String is = "* Game Id: " + this.id + "\n"; 124 | String ss = "* Score: " + this.score + "\n"; 125 | String js = "* Jumps: " + this.jumps + "\n"; 126 | String dis = "* Dist.: " + this.getDistance() + " px \n"; 127 | String ds = "* Date: " + this.date + "\n"; 128 | String rs = "* Revived: " + this.hasRevived + "\n"; 129 | return ms + ps + is + ss + js + dis + ds + rs; 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/gameEngine/bubbles/Bubble.java: -------------------------------------------------------------------------------- 1 | package gameEngine.bubbles; 2 | 3 | import gameEngine.GamePlay; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import javafx.scene.paint.Color; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class Bubble { 10 | private double x, y; 11 | private final double radius; 12 | private final GraphicsContext graphicsContext; 13 | private double Vx, Vy; 14 | 15 | private final Color color; 16 | 17 | Bubble(double x, double y, double radius, double Vx, double Vy, Color color, GraphicsContext graphicsContext) { 18 | this.x = x; 19 | this.y = y; 20 | this.radius = radius; 21 | this.Vx = Vx; 22 | this.Vy = Vy; 23 | this.graphicsContext = graphicsContext; 24 | this.color = color; 25 | } 26 | 27 | public void move(double time) { 28 | x = x + Vx * time; 29 | y = y + Vy * time; 30 | 31 | if (x < radius) { 32 | x = radius; 33 | Vx *= -1; 34 | } else if (x > GamePlay.WIDTH - radius) { 35 | x = GamePlay.WIDTH - radius; 36 | Vx *= -1; 37 | } 38 | if (y < radius) { 39 | y = radius; 40 | Vy *= -1; 41 | } else if (y > GamePlay.HEIGHT - radius) { 42 | y = GamePlay.HEIGHT - radius; 43 | Vy *= -1; 44 | } 45 | } 46 | 47 | public void clipBubble() { 48 | graphicsContext.moveTo(x, y); 49 | graphicsContext.arc(x, y, radius, radius, 0, 360); 50 | } 51 | 52 | public void color() { 53 | graphicsContext.setFill(color.deriveColor(1, 1, 1, 0.1)); 54 | graphicsContext.fillOval(x - radius, y - radius, 2 * radius, 2 * radius); 55 | } 56 | 57 | public void elasticCollisions(ArrayList fireFlies) { 58 | for (Bubble bubble : fireFlies) { 59 | if (bubble == this) continue; 60 | if (checkCollision(bubble)) { 61 | double vx = Vx, vy = Vy; 62 | double v2x = bubble.getVx(), v2y = bubble.getVy(); 63 | double r1 = radius, r2 = bubble.getRadius(); 64 | Vx = (r1 - r2) / (r1 + r2) * vx + 2 * (r2) / (r1 + r2) * v2x; 65 | bubble.setVx(2 * r1 / (r1 + r2) * vx + (r2 - r1) / (r1 + r2) * v2x); 66 | 67 | Vy = (r1 - r2) / (r1 + r2) * vy + 2 * (r2) / (r1 + r2) * v2y; 68 | bubble.setVy(2 * r1 / (r1 + r2) * vy + (r2 - r1) / (r1 + r2) * v2y); 69 | } 70 | } 71 | } 72 | 73 | 74 | public boolean checkCollision(Bubble bubble) { 75 | double distance = (x - bubble.getX()) * (x - bubble.getX()) 76 | + (y - bubble.getY()) * (y - bubble.getY()); 77 | 78 | return distance < (radius + bubble.getRadius()) * (radius + bubble.getRadius()); 79 | } 80 | 81 | public void setVx(double vx) { 82 | Vx = vx; 83 | } 84 | 85 | public void setVy(double vy) { 86 | Vy = vy; 87 | } 88 | 89 | public double getX() { 90 | return x; 91 | } 92 | 93 | public double getY() { 94 | return y; 95 | } 96 | 97 | public double getRadius() { 98 | return radius; 99 | } 100 | 101 | public double getVx() { 102 | return Vx; 103 | } 104 | 105 | public double getVy() { 106 | return Vy; 107 | } 108 | 109 | public void debug() { 110 | graphicsContext.beginPath(); 111 | graphicsContext.setLineWidth(2); 112 | graphicsContext.arc(x, y, radius, radius, 0, 360); 113 | graphicsContext.closePath(); 114 | graphicsContext.stroke(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /src/gameEngine/bubbles/Bubbles.java: -------------------------------------------------------------------------------- 1 | package gameEngine.bubbles; 2 | 3 | import gameEngine.GamePlay; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import javafx.scene.paint.Color; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Random; 9 | 10 | public class Bubbles { 11 | 12 | ArrayList bubbles; 13 | private final int numberOfBubbles = 30; 14 | private final GraphicsContext graphicsContext; 15 | 16 | private final ArrayList colors = new ArrayList<>() 17 | {{ 18 | add(Color.web("F6DF0E")); 19 | add(Color.web("8E11FE")); 20 | add(Color.web("32E1F4")); 21 | add(Color.web("FD0082")); 22 | }}; 23 | 24 | public Bubbles(GraphicsContext graphicsContext) { 25 | bubbles = new ArrayList<>(); 26 | this.graphicsContext = graphicsContext; 27 | generate(); 28 | } 29 | 30 | public Color getRandomColor() { 31 | Random random = new Random(); 32 | return colors.get(random.nextInt(colors.size())); 33 | } 34 | 35 | private void generate() { 36 | Random random = new Random(); 37 | double radius, x, y, Vx, Vy; 38 | int dir; 39 | for (int i = 0; i < numberOfBubbles; ++i) { 40 | radius = random.nextInt(60) + 20; 41 | x = (random.nextDouble() * 1000) % (GamePlay.WIDTH - radius) + radius; 42 | y = (random.nextDouble() * 1000) % (GamePlay.HEIGHT - radius) + radius; 43 | Vx = random.nextInt(150) + 20; 44 | Vy = random.nextInt(150) + 20; 45 | dir = random.nextInt(4); 46 | if (dir == 1) { 47 | Vx *= -1; 48 | } else if (dir == 2) { 49 | Vx *= -1; 50 | Vy *= -1; 51 | } else if (dir == 3) { 52 | Vy *= -1; 53 | } 54 | Bubble bubble = new Bubble(x, y, radius, Vx, Vy, getRandomColor(), graphicsContext); 55 | bubbles.add(bubble); 56 | } 57 | } 58 | 59 | public void clip() { 60 | 61 | graphicsContext.beginPath(); 62 | for (Bubble bubble : bubbles) { 63 | bubble.clipBubble(); 64 | } 65 | } 66 | 67 | public void move(double time) { 68 | for (Bubble bubble : bubbles) { 69 | bubble.move(time); 70 | } 71 | } 72 | 73 | public void color() { 74 | for (Bubble bubble : bubbles) 75 | bubble.color(); 76 | } 77 | 78 | public void debug() { 79 | for (Bubble bubble : bubbles) bubble.debug(); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/gameEngine/customExceptions/FallOutException.java: -------------------------------------------------------------------------------- 1 | package gameEngine.customExceptions; 2 | 3 | public class FallOutException extends GameOverException { 4 | public FallOutException() { 5 | super("Ball fell out of the screen"); 6 | } 7 | @Override 8 | public String toString() { 9 | return "FallOutException"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/gameEngine/customExceptions/GameOverException.java: -------------------------------------------------------------------------------- 1 | package gameEngine.customExceptions; 2 | 3 | public abstract class GameOverException extends Exception { 4 | public GameOverException(String s) { 5 | super(s); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/gameEngine/customExceptions/InsufficientStarsException.java: -------------------------------------------------------------------------------- 1 | package gameEngine.customExceptions; 2 | 3 | import gameEngine.App; 4 | 5 | public class InsufficientStarsException extends Exception { 6 | public InsufficientStarsException(int have) { 7 | super("Need: " + App.REVIVAL_STARS + " Have: " + have); 8 | } 9 | @Override 10 | public String toString() { 11 | return "InsufficientStarsException"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/gameEngine/customExceptions/ObstacleCollisionException.java: -------------------------------------------------------------------------------- 1 | package gameEngine.customExceptions; 2 | 3 | import gameEngine.gameElements.obstacles.Obstacle; 4 | 5 | public class ObstacleCollisionException extends GameOverException { 6 | public ObstacleCollisionException(Class T) { 7 | super("Ball collision with " + T.getName()); 8 | } 9 | @Override 10 | public String toString() { 11 | return "ObstacleCollisionException"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/GameElement.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements; 2 | 3 | import gameEngine.App; 4 | import gameEngine.Ball; 5 | import gameEngine.gameElements.obstacles.Obstacle; 6 | import javafx.scene.canvas.GraphicsContext; 7 | import javafx.scene.media.AudioClip; 8 | 9 | import java.io.File; 10 | import java.io.Serializable; 11 | 12 | // template and factory pattern ig 13 | public abstract class GameElement implements Serializable { 14 | 15 | private static final long serialVersionUID = 2021L; 16 | 17 | protected double x; 18 | protected double y; 19 | protected double topY, bottomY; 20 | 21 | protected String audioClipPath; 22 | 23 | private transient AudioClip audioClip; 24 | 25 | public GameElement(double x, double y, double topY, double bottomY) { 26 | this.x = x; 27 | this.y = y; 28 | this.topY = topY; 29 | this.bottomY = bottomY; 30 | } 31 | 32 | public void loadAssets() { // after deserialization 33 | if (this instanceof HighScoreLine) return; 34 | assert (this.audioClipPath != null); 35 | this.audioClip = new AudioClip(new File(this.audioClipPath).toURI().toString()); 36 | this.audioClip.setVolume(0.5); 37 | } 38 | 39 | public double getTopY() { 40 | return topY; 41 | } 42 | public double getBottomY() { 43 | return bottomY; 44 | } 45 | 46 | public double getX() { 47 | return x; 48 | } 49 | 50 | public double getY() { 51 | return y; 52 | } 53 | 54 | public void playSound() { 55 | if (this instanceof Obstacle) // as game over, maybe do this in game over exception 56 | App.BgMediaPlayer.stop(); 57 | try { 58 | this.audioClip.play(); // TEMPORARY // TODO: MUSIC DISABLE 59 | } catch (NullPointerException e) { // TODO: FIX STAR ASSET 60 | System.out.println(this.getClass().toString() + "Caught asset loading in star, " + e.toString()); 61 | this.audioClip = new AudioClip(new File(this.audioClipPath).toURI().toString()); 62 | this.audioClip.setVolume(0.5); 63 | this.audioClip.play(); 64 | } 65 | } 66 | 67 | public void applyOffset(double offset) { 68 | y += offset; 69 | topY += offset; 70 | bottomY += offset; 71 | } 72 | 73 | public abstract void refresh(GraphicsContext graphicsContext); 74 | public abstract boolean checkCollision(Ball ball); 75 | public abstract void destroy(); 76 | } 77 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/HighScoreLine.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.util.Renderer; 5 | import javafx.scene.canvas.GraphicsContext; 6 | import javafx.scene.image.Image; 7 | import javafx.scene.paint.Color; 8 | 9 | import java.io.File; 10 | 11 | public class HighScoreLine extends GameElement { 12 | 13 | private static final Image image = new Image(new File("src/assets/gameplay/crown_s.png").toURI().toString()); 14 | 15 | public HighScoreLine(double y) { 16 | super(0, y, y, y); 17 | } 18 | @Override 19 | public void refresh(GraphicsContext graphicsContext){ 20 | graphicsContext.drawImage(image, 5, y - image.getHeight()/1.5); 21 | Renderer.drawDashedLine(image.getWidth() + 13, y, 2, 10, 5, Color.WHITE); 22 | } 23 | @Override 24 | public boolean checkCollision(Ball ball) { 25 | return false; 26 | } 27 | 28 | @Override 29 | public void destroy() { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/Star.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import javafx.scene.image.Image; 6 | 7 | import java.io.File; 8 | 9 | public class Star extends GameElement { 10 | 11 | private static final int closestSafeDist = 100; 12 | private static final int points = 0; 13 | 14 | private static final Image image = new Image(new File("src/assets/gameplay/star.png").toURI().toString()); 15 | 16 | public Star(double x, double y) { 17 | super(x, y, y, y); 18 | audioClipPath = "src/assets/music/gameplay/star.wav"; 19 | this.loadAssets(); // need to ensure that audio clip path has been set 20 | } 21 | 22 | @Override 23 | public void refresh(GraphicsContext graphicsContext) { 24 | double x = getX(); 25 | double y = getY(); 26 | x -= image.getWidth()/2; 27 | y -= image.getHeight()/2; 28 | graphicsContext.drawImage(image, x, y); 29 | } 30 | 31 | @Override 32 | public boolean checkCollision(Ball ball) { 33 | boolean ret = ball.getY() < getY() + 20; 34 | if (ret) destroy(); 35 | return ret; 36 | } 37 | 38 | @Override 39 | public void destroy() { 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/SwitchColor.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.gameElements.obstacles.Obstacle; 5 | import javafx.scene.canvas.GraphicsContext; 6 | import javafx.scene.image.Image; 7 | 8 | import java.io.File; 9 | 10 | public class SwitchColor extends GameElement { 11 | 12 | private Obstacle obstacle; 13 | 14 | private static final int closestSafeDist = 100; 15 | private static int points = 0; 16 | 17 | private static final Image image = new Image(new File("src/assets/gameplay/color_switcher_s.png").toURI().toString()); 18 | 19 | public SwitchColor(double x, double y) { 20 | super(x, y, y, y); 21 | audioClipPath = "src/assets/music/gameplay/colorSwitch.wav"; 22 | this.loadAssets(); // need to ensure that audio clip path has been set 23 | } 24 | 25 | @Override 26 | public void refresh(GraphicsContext graphicsContext) { 27 | double x = getX(); 28 | double y = getY(); 29 | x -= image.getWidth()/2; 30 | y -= image.getHeight()/2; 31 | graphicsContext.drawImage(image, x, y); 32 | } 33 | 34 | @Override 35 | public boolean checkCollision(Ball ball) { 36 | if (ball.getY() < getY() + 18) { 37 | String prev = ball.getColor(); 38 | // If the number of colors in ball is small enough (== 1 or 2) infinite loop may occur 39 | String color = prev; 40 | while (color.equals(prev)) { 41 | color = obstacle.getRandomColor(); 42 | } 43 | ball.setColor(color); 44 | destroy(); 45 | points++; 46 | return true; 47 | } 48 | return false; 49 | } 50 | 51 | @Override 52 | public void destroy() { 53 | 54 | } 55 | 56 | public void setObstacle(Obstacle obstacle) { 57 | this.obstacle = obstacle; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsCircle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.util.Renderer; 5 | import gameEngine.gameElements.Star; 6 | import javafx.scene.canvas.GraphicsContext; 7 | import javafx.scene.paint.Color; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Random; 11 | 12 | public class ObsCircle extends Obstacle { 13 | 14 | protected final double radius; 15 | protected final double innerRadius; 16 | protected double rotationAngle; 17 | 18 | protected ArrayList colors = new ArrayList<>() 19 | {{ 20 | add("F6DF0E"); 21 | add("8E11FE"); 22 | add("32E1F4"); 23 | add("FD0082"); 24 | }}; 25 | 26 | public ObsCircle(double x, double y, double radius, double width) { 27 | super(x, y, y - radius, y + radius); 28 | star = new Star(x, y); 29 | this.radius = radius; 30 | this.innerRadius = radius - width; 31 | rotationAngle = 0; 32 | } 33 | 34 | public double getRadius() { 35 | return radius; 36 | } 37 | 38 | @Override 39 | public void refresh(GraphicsContext graphicsContext) { 40 | if (star != null) { 41 | star.refresh(graphicsContext); 42 | } 43 | graphicsContext.translate(getX(), getY()); 44 | graphicsContext.rotate(-rotationAngle); 45 | int angle = 0; 46 | for (String color : colors) { 47 | Renderer.drawArc(0, 0, radius, innerRadius, Color.web(color), Color.web(color), angle++); 48 | } 49 | graphicsContext.rotate(rotationAngle); 50 | graphicsContext.translate(-getX(), -getY()); 51 | } 52 | 53 | 54 | @Override 55 | public void update(double time) { 56 | rotationAngle += rotationalSpeed * time; 57 | while(rotationAngle < 0) { 58 | rotationAngle += 360; 59 | } 60 | rotationAngle %= 360; 61 | } 62 | 63 | public double getRotationAngle() { 64 | return rotationAngle; 65 | } 66 | 67 | @Override 68 | public boolean checkCollision(Ball ball) { 69 | 70 | double top = ball.getY() - ball.getRadius(); 71 | double bottom = ball.getY() + ball.getRadius(); 72 | int angle = (int)rotationAngle % 360; 73 | boolean isCollided = false; 74 | 75 | if ((top < getY() + radius && bottom > getY() + innerRadius)) { 76 | 77 | if (angle > 355 || (angle > 0 && angle < 95)) { 78 | isCollided = checkNotEqual(colors.get(2), ball.getColor()); 79 | } 80 | if (angle > 85 && angle < 185) { 81 | isCollided |= checkNotEqual(colors.get(1), ball.getColor()); 82 | } 83 | if (angle > 175 && angle < 275) { 84 | isCollided |= checkNotEqual(colors.get(0), ball.getColor()); 85 | } 86 | if ((angle > 265) || (angle < 5)) { 87 | isCollided |= checkNotEqual(colors.get(3), ball.getColor()); 88 | } 89 | } else if ((top < getY() - innerRadius && bottom > getY() - radius)) { 90 | 91 | if (angle > 355 || (angle > 0 && angle < 95)) { 92 | isCollided = checkNotEqual(colors.get(0), ball.getColor()); 93 | } 94 | if (angle > 85 && angle < 185) { 95 | isCollided |= checkNotEqual(colors.get(3), ball.getColor()); 96 | } 97 | if (angle > 175 && angle < 275) { 98 | isCollided |= checkNotEqual(colors.get(2), ball.getColor()); 99 | } 100 | if ((angle > 265) || (angle < 5)) { 101 | isCollided |= checkNotEqual(colors.get(1), ball.getColor()); 102 | } 103 | } 104 | 105 | return isCollided; 106 | } 107 | 108 | public void setRotationAngle(double rotationAngle) { 109 | this.rotationAngle = rotationAngle; 110 | } 111 | 112 | public void setColors(ArrayList colors) { 113 | this.colors = colors; 114 | } 115 | 116 | public void rotate(double angle) { 117 | rotationAngle += angle; 118 | while(rotationAngle < 0) { 119 | rotationAngle += 360; 120 | } 121 | rotationAngle %= 360; 122 | } 123 | 124 | @Override 125 | public void destroy() { 126 | 127 | } 128 | 129 | @Override 130 | public String getRandomColor() { 131 | Random random = new Random(); 132 | return colors.get(random.nextInt(colors.size())); 133 | } 134 | 135 | public void mirrorY() { 136 | // mirror Image of circle 137 | colors = new ArrayList<>() 138 | {{ 139 | add("F6DF0E"); 140 | add("FD0082"); 141 | add("32E1F4"); 142 | add("8E11FE"); 143 | }}; 144 | } 145 | 146 | public ObsCircle generateNext() { 147 | return new ObsCircle(x, y - 2 * radius - 5, radius, radius - innerRadius); 148 | } 149 | 150 | } 151 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsCircleTriangle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | 6 | import java.util.Random; 7 | 8 | public class ObsCircleTriangle extends Obstacle { 9 | 10 | private final ObsTriangle triangle; 11 | private final ObsCircle circle; 12 | 13 | public ObsCircleTriangle(double x, double y, double sideLength, double width) { 14 | super(x, y, y - sideLength / Math.sqrt(3), y + sideLength/Math.sqrt(3)); 15 | triangle = new ObsTriangle(x, y, sideLength, width); 16 | circle = new ObsCircle(x, y, sideLength / (2 * Math.sqrt(3)) - width, width/2); 17 | circle.destroyStar(); 18 | circle.rotate(80); 19 | circle.mirrorY(); 20 | } 21 | 22 | @Override 23 | public void refresh(GraphicsContext graphicsContext) { 24 | triangle.refresh(graphicsContext); 25 | circle.refresh(graphicsContext); 26 | } 27 | 28 | @Override 29 | public boolean checkCollision(Ball ball) { 30 | return circle.checkCollision(ball) || triangle.checkCollision(ball); 31 | } 32 | 33 | @Override 34 | public void destroy() { 35 | 36 | } 37 | 38 | @Override 39 | public String getRandomColor() { 40 | Random random = new Random(); 41 | return triangle.getColors().get(random.nextInt(triangle.getColors().size() - 1)); 42 | } 43 | 44 | @Override 45 | public void applyOffset(double offset) { 46 | super.applyOffset(offset); 47 | circle.applyOffset(offset); 48 | triangle.applyOffset(offset); 49 | } 50 | 51 | @Override 52 | public boolean checkCollisionStar(Ball ball) { 53 | return triangle.checkCollisionStar(ball); 54 | } 55 | 56 | @Override 57 | public void update(double time) { 58 | circle.update(-time); 59 | triangle.update(time); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsConsecutiveCircles.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import java.util.ArrayList; 6 | 7 | public class ObsConsecutiveCircles extends Obstacle { 8 | 9 | private ArrayList circles; 10 | 11 | public ObsConsecutiveCircles(ObsCircle obsCircle, int numberOfCircles) { 12 | super(obsCircle.getX(), obsCircle.getY(), obsCircle.getY() - (2 * numberOfCircles - 1) * obsCircle.getRadius(), obsCircle.getY() + obsCircle.getRadius()); 13 | circles = new ArrayList<>(); 14 | circles.add(obsCircle); 15 | for (int i = 0; i < numberOfCircles - 1; ++i) { 16 | circles.add(circles.get(i).generateNext()); 17 | if (i % 2 == 0) { 18 | circles.get(i + 1).rotate(180); 19 | } 20 | } 21 | } 22 | 23 | @Override 24 | public void setRotationalSpeed(double speed) { 25 | for (ObsCircle obsCircle : circles) { 26 | obsCircle.setRotationalSpeed(speed); 27 | } 28 | } 29 | 30 | @Override 31 | public String getRandomColor() { 32 | return circles.get(0).getRandomColor(); 33 | } 34 | 35 | @Override 36 | public void update(double time) { 37 | for (ObsCircle obsCircle : circles) { 38 | obsCircle.update(time); 39 | } 40 | } 41 | 42 | @Override 43 | public void refresh(GraphicsContext graphicsContext) { 44 | for (ObsCircle obsCircle : circles) { 45 | obsCircle.refresh(graphicsContext); 46 | } 47 | } 48 | 49 | @Override 50 | public boolean checkCollision(Ball ball) { 51 | boolean isCollided = false; 52 | for (ObsCircle obsCircle : circles) { 53 | isCollided |= obsCircle.checkCollision(ball); 54 | } 55 | return isCollided; 56 | } 57 | 58 | @Override 59 | public void applyOffset(double offset) { 60 | super.applyOffset(offset); 61 | for (ObsCircle obsCircle : circles) { 62 | obsCircle.applyOffset(offset); 63 | } 64 | } 65 | 66 | @Override 67 | public void destroy() { 68 | 69 | } 70 | 71 | @Override 72 | public boolean checkCollisionStar(Ball ball) { 73 | boolean isCollided = false; 74 | for (ObsCircle obsCircle : circles) { 75 | isCollided |= obsCircle.checkCollisionStar(ball); 76 | } 77 | return isCollided; 78 | } 79 | 80 | @Override 81 | public int getMaxCount() { 82 | return circles.size(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsDoubleCircle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | 6 | public class ObsDoubleCircle extends ObsCircle { 7 | 8 | private final ObsCircle innerCircle; 9 | 10 | public ObsDoubleCircle(double x, double y, double innerRadius, double outerRadius, double width) { 11 | super(x, y, outerRadius, width); 12 | super.destroyStar(); // only one star for one two circles 13 | super.mirrorY(); 14 | innerCircle = new ObsCircle(x, y, innerRadius, width); 15 | rotationAngle = 45; 16 | innerCircle.setRotationAngle(45); 17 | setColors(colors); 18 | } 19 | 20 | @Override 21 | public void refresh(GraphicsContext graphicsContext) { 22 | super.refresh(graphicsContext); 23 | innerCircle.refresh(graphicsContext); 24 | } 25 | 26 | @Override 27 | public void setRotationalSpeed(double rotationalSpeed) { 28 | super.setRotationalSpeed(rotationalSpeed); 29 | innerCircle.setRotationalSpeed(rotationalSpeed); 30 | } 31 | @Override 32 | public boolean checkCollision(Ball ball) { 33 | return super.checkCollision(ball) || innerCircle.checkCollision(ball); 34 | } 35 | 36 | @Override 37 | public boolean checkCollisionStar(Ball ball) { 38 | return super.checkCollisionStar(ball) || innerCircle.checkCollisionStar(ball); 39 | } 40 | 41 | @Override 42 | public void rotate(double angle) { 43 | super.rotate(angle); 44 | innerCircle.rotate(angle); 45 | } 46 | 47 | @Override 48 | public void destroy() { 49 | 50 | } 51 | 52 | @Override 53 | public void destroyStar() { 54 | super.destroyStar(); 55 | innerCircle.destroyStar(); 56 | } 57 | 58 | @Override 59 | public void applyOffset(double offset) { 60 | super.applyOffset(offset); 61 | innerCircle.applyOffset(offset); 62 | } 63 | 64 | @Override 65 | public void update(double time) { 66 | super.update(time); 67 | innerCircle.update(-time); 68 | } 69 | 70 | @Override 71 | public ObsCircle generateNext() { 72 | return new ObsDoubleCircle(x, y - 2 * radius - 5, innerCircle.radius, radius, radius - innerRadius); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsLine.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.GamePlay; 5 | import gameEngine.util.Renderer; 6 | import gameEngine.gameElements.Star; 7 | import javafx.scene.canvas.GraphicsContext; 8 | import javafx.scene.paint.Color; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Random; 12 | 13 | public class ObsLine extends Obstacle { 14 | 15 | private final double length; 16 | private double startingPoint = 0; // a reference point to assess rotation 17 | private final double width = GamePlay.WIDTH/4; 18 | 19 | private ArrayList colors = new ArrayList<>() 20 | {{ 21 | add("F6DF0E"); 22 | add("8E11FE"); 23 | add("32E1F4"); 24 | add("FD0082"); 25 | }}; 26 | 27 | 28 | public ObsLine(double x, double y, double length) { 29 | // x can be anything doesn't matter 30 | // y is the higher part of line 31 | // safeDist is zero as y is the higher part 32 | super(x, y, y - length, y + length); 33 | this.length = length; 34 | translationSpeed = 180; 35 | closestStar = 40; 36 | star = new Star(x, y - 40); 37 | } 38 | 39 | @Override 40 | public void refresh(GraphicsContext graphicsContext) { 41 | if (star != null) { 42 | star.refresh(graphicsContext); 43 | } 44 | double Left = startingPoint; 45 | for (int i = 0; i < 4; ++i) { 46 | Renderer.drawFoldingRed(Left, getY() - length/2, width, length, Color.web(colors.get(i))); 47 | Left += width; 48 | Left %= GamePlay.WIDTH; 49 | } 50 | } 51 | 52 | @Override 53 | public boolean checkCollision(Ball ball) { 54 | double top = ball.getY() - ball.getRadius(); 55 | double bottom = ball.getY() + ball.getRadius(); 56 | double Left = startingPoint; 57 | if ((top < getY() + length/2 && bottom > getY() - length/2)) { 58 | boolean isCollided = false; 59 | if (ball.getX() + ball.getRadius() > Left && ball.getX() - ball.getRadius() < Left + width) { 60 | isCollided = checkNotEqual(ball.getColor(), colors.get(0)); 61 | } 62 | Left += width; 63 | Left %= GamePlay.WIDTH; 64 | if (ball.getX() + ball.getRadius() > Left && ball.getX() - ball.getRadius() < Left + width) { 65 | isCollided |= checkNotEqual(ball.getColor(), colors.get(1)); 66 | } 67 | Left += width; 68 | Left %= GamePlay.WIDTH; 69 | if (ball.getX() + ball.getRadius() > Left && ball.getX() - ball.getRadius() < Left + width) { 70 | isCollided |= checkNotEqual(ball.getColor(), colors.get(2)); 71 | } 72 | Left += width; 73 | Left %= GamePlay.WIDTH; 74 | if (ball.getX() + ball.getRadius() > Left && ball.getX() - ball.getRadius() < Left + width) { 75 | isCollided |= checkNotEqual(ball.getColor(), colors.get(3)); 76 | } 77 | return isCollided; 78 | } 79 | 80 | return false; 81 | } 82 | 83 | @Override 84 | public void destroy() { 85 | 86 | } 87 | 88 | @Override 89 | public void update(double time) { 90 | startingPoint += translationSpeed * time; 91 | startingPoint %= GamePlay.WIDTH; 92 | } 93 | 94 | @Override 95 | public String getRandomColor() { 96 | Random random = new Random(); 97 | return colors.get(random.nextInt(colors.size())); 98 | } 99 | 100 | public void setColors(ArrayList colors) { 101 | this.colors = colors; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsOscillatingCircle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.gameElements.Star; 5 | import javafx.scene.canvas.GraphicsContext; 6 | 7 | public class ObsOscillatingCircle extends Obstacle { 8 | 9 | private final ObsCircle circle; 10 | 11 | public ObsOscillatingCircle(double x, double y, double radius, double width) { 12 | super(x, y - radius/2, y - 2 * radius, y + radius); 13 | circle = new ObsCircle(x, y - radius/2, radius, width); 14 | } 15 | 16 | @Override 17 | public void applyOffset(double offset) { 18 | super.applyOffset(offset); 19 | circle.applyOffset(offset); 20 | } 21 | 22 | 23 | @Override 24 | public void refresh(GraphicsContext graphicsContext) { 25 | circle.refresh(graphicsContext); 26 | 27 | } 28 | 29 | @Override 30 | public boolean checkCollision(Ball ball) { 31 | return circle.checkCollision(ball); 32 | } 33 | 34 | @Override 35 | public void destroy() { 36 | 37 | } 38 | 39 | @Override 40 | public String getRandomColor() { 41 | return circle.getRandomColor(); 42 | } 43 | 44 | @Override 45 | public void update(double time) { 46 | circle.update(time); 47 | double pos = y + Math.sin((2 * Math.PI)/360 * circle.getRotationAngle()) * (circle.getRadius()/2 - 10); 48 | double difference = pos - circle.getY(); 49 | circle.applyOffset(difference); 50 | Star star = circle.getStar(); 51 | if (star != null) { 52 | star.applyOffset(-difference); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean checkCollisionStar(Ball ball) { 58 | return circle.checkCollisionStar(ball); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsOscillatingSquare.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.gameElements.Star; 5 | import javafx.scene.canvas.GraphicsContext; 6 | 7 | public class ObsOscillatingSquare extends Obstacle { 8 | 9 | private final ObsSquare obsSquare; 10 | 11 | public ObsOscillatingSquare(double x, double y, double sideLength, double width) { 12 | super(x, y, y - sideLength/2 * Math.sqrt(2) - sideLength + 130, y + sideLength/2 * Math.sqrt(2) + sideLength - 130); 13 | obsSquare = new ObsSquare(x, y, sideLength, width); 14 | } 15 | 16 | @Override 17 | public void applyOffset(double offset) { 18 | super.applyOffset(offset); 19 | obsSquare.applyOffset(offset); 20 | } 21 | 22 | 23 | @Override 24 | public void refresh(GraphicsContext graphicsContext) { 25 | obsSquare.refresh(graphicsContext); 26 | } 27 | 28 | @Override 29 | public boolean checkCollision(Ball ball) { 30 | return obsSquare.checkCollision(ball); 31 | } 32 | 33 | @Override 34 | public void destroy() { 35 | 36 | } 37 | 38 | @Override 39 | public String getRandomColor() { 40 | return obsSquare.getRandomColor(); 41 | } 42 | 43 | @Override 44 | public void update(double time) { 45 | obsSquare.update(time); 46 | double pos = y + Math.sin((2 * Math.PI)/360 * obsSquare.getRotationAngle()) * (obsSquare.getSideLength() - 130); 47 | double difference = pos - obsSquare.getY(); 48 | obsSquare.applyOffset(difference); 49 | Star star = obsSquare.getStar(); 50 | if (star != null) { 51 | star.applyOffset(-difference); 52 | } 53 | } 54 | 55 | @Override 56 | public boolean checkCollisionStar(Ball ball) { 57 | return obsSquare.checkCollisionStar(ball); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsSquare.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.util.Pair; 5 | import gameEngine.util.Renderer; 6 | import gameEngine.gameElements.Star; 7 | import javafx.scene.canvas.GraphicsContext; 8 | import javafx.scene.paint.Color; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Random; 12 | 13 | public class ObsSquare extends Obstacle { 14 | 15 | private double width; 16 | private double sideLength; 17 | private double rotationAngle; 18 | private ArrayList colors = new ArrayList<>() 19 | {{ 20 | add("F6DF0E"); // yellow 21 | add("FD0082"); // pink 22 | add("32E1F4"); // cyan 23 | add("8E11FE"); // purple 24 | }}; 25 | 26 | public ObsSquare(double x, double y, double sideLength, double width) { 27 | super(x, y, y - sideLength/2 * Math.sqrt(2), y + sideLength/2 * Math.sqrt(2)); 28 | this.width = width; 29 | this.sideLength = sideLength; 30 | star = new Star(x, y); 31 | } 32 | 33 | public double getRotationAngle() { 34 | return rotationAngle; 35 | } 36 | 37 | public double getSideLength() { 38 | return sideLength; 39 | } 40 | 41 | @Override 42 | public void refresh(GraphicsContext graphicsContext) { 43 | if (star != null) { 44 | star.refresh(graphicsContext); 45 | } 46 | graphicsContext.translate(getX(), getY()); 47 | graphicsContext.rotate(-rotationAngle); 48 | 49 | double topLeftX, topLeftY, topRightX, topRightY; 50 | double bottomLeftX, bottomRightX, bottomLeftY, bottomRightY; 51 | topLeftX = - sideLength/2; 52 | topLeftY = - sideLength/2; 53 | topRightX = + sideLength/2; 54 | topRightY = - sideLength/2; 55 | bottomLeftX = - sideLength/2; 56 | bottomLeftY = + sideLength/2; 57 | 58 | graphicsContext.setFill(Color.web(colors.get(0))); 59 | graphicsContext.fillRoundRect(topLeftX, topLeftY, sideLength, width, width, width); 60 | 61 | graphicsContext.setFill(Color.web(colors.get(1))); 62 | graphicsContext.fillRoundRect(topRightX - width, topRightY, width, sideLength, width, width); 63 | 64 | graphicsContext.setFill(Color.web(colors.get(2))); 65 | graphicsContext.fillRoundRect(bottomLeftX, bottomLeftY - width, sideLength, width, width, width); 66 | 67 | graphicsContext.setFill(Color.web(colors.get(3))); 68 | graphicsContext.fillRoundRect(topLeftX, topLeftY, width, sideLength, width, width); 69 | 70 | graphicsContext.setFill(Color.web(colors.get(0))); 71 | graphicsContext.fillRoundRect(topLeftX, topLeftY, sideLength/2, width, width, width); 72 | 73 | 74 | graphicsContext.rotate(rotationAngle); 75 | graphicsContext.translate(-getX(), -getY()); 76 | } 77 | 78 | @Override 79 | public void update(double time) { 80 | rotationAngle += rotationalSpeed * time; 81 | while(rotationAngle < 0) { 82 | rotationAngle += 360; 83 | } 84 | rotationAngle %= 360; 85 | } 86 | 87 | @Override 88 | public boolean checkCollision(Ball ball) { 89 | 90 | double X = getX(); 91 | double Y = getY(); 92 | 93 | double signX = -1, signY = -1; 94 | ArrayList points = new ArrayList<>(); 95 | 96 | for (int i = 0; i < 4; ++i) { 97 | Pair point = new Pair(0, 0); 98 | point.first = Renderer.rotateX(signX * sideLength/2, signY * sideLength/2, rotationAngle) + X; 99 | point.second = Renderer.rotateY(signX * sideLength/2, signY * sideLength/2, rotationAngle) + Y; 100 | points.add(point); 101 | if (i % 2 == 0) { 102 | signX *= -1; 103 | }else { 104 | signY *= -1; 105 | } 106 | } 107 | 108 | boolean insideBigger = false; 109 | 110 | double p1, p2; 111 | for (int i = 0; i < 360; i+=2) { 112 | p1 = Renderer.rotateX(0, -ball.getRadius(), i) + ball.getX(); 113 | p2 = Renderer.rotateY(0, -ball.getRadius(), i) + ball.getY(); 114 | insideBigger |= Renderer.checkInside(points, p1, p2); 115 | } 116 | 117 | points = new ArrayList<>(); 118 | signX = -1; signY = -1; 119 | for (int i = 0; i < 4; ++i) { 120 | Pair point = new Pair(0, 0); 121 | point.first = Renderer.rotateX(signX * (sideLength/2 - width), signY * (sideLength/2 - width), rotationAngle) + X; 122 | point.second = Renderer.rotateY(signX * (sideLength/2 - width), signY * (sideLength/2 - width), rotationAngle) + Y; 123 | points.add(point); 124 | if (i % 2 == 0) { 125 | signX *= -1; 126 | }else { 127 | signY *= -1; 128 | } 129 | } 130 | 131 | boolean insideSmaller = true; 132 | 133 | for (int i = 0; i < 360; i+=2) { 134 | p1 = Renderer.rotateX(0, ball.getRadius(), i) + ball.getX(); 135 | p2 = Renderer.rotateY(0, ball.getRadius(), i) + ball.getY(); 136 | insideSmaller &= Renderer.checkInside(points, p1, p2); 137 | } 138 | boolean isCollided = false; 139 | if (insideBigger && !insideSmaller) { 140 | if (rotationAngle < 45 || rotationAngle > 315) { 141 | if (ball.getY() < getY()) { 142 | // above 143 | isCollided = checkNotEqual(colors.get(0), ball.getColor()); 144 | }else { 145 | isCollided = checkNotEqual(colors.get(2), ball.getColor()); 146 | } 147 | } 148 | if (rotationAngle > 45 && rotationAngle < 135) { 149 | if (ball.getY() < getY()) { 150 | // above 151 | isCollided = checkNotEqual(colors.get(1), ball.getColor()); 152 | }else { 153 | isCollided = checkNotEqual(colors.get(3), ball.getColor()); 154 | } 155 | } 156 | if (rotationAngle > 135 && rotationAngle < 225) { 157 | if (ball.getY() < getY()) { 158 | // above 159 | isCollided = checkNotEqual(colors.get(2), ball.getColor()); 160 | }else { 161 | isCollided = checkNotEqual(colors.get(0), ball.getColor()); 162 | } 163 | } 164 | 165 | if (rotationAngle > 225 && rotationAngle < 315) { 166 | if (ball.getY() < getY()) { 167 | // above 168 | isCollided = checkNotEqual(colors.get(3), ball.getColor()); 169 | }else { 170 | isCollided = checkNotEqual(colors.get(1), ball.getColor()); 171 | } 172 | } 173 | } 174 | return isCollided; 175 | } 176 | 177 | @Override 178 | public void destroy() { 179 | 180 | } 181 | 182 | @Override 183 | public String getRandomColor() { 184 | Random random = new Random(); 185 | return colors.get(random.nextInt(colors.size())); 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsSquareCircle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | 6 | public class ObsSquareCircle extends Obstacle { 7 | 8 | ObsSquare square; 9 | ObsCircle circle; 10 | 11 | public ObsSquareCircle(double x, double y, double sideLength, double width) { 12 | super(x, y, y - sideLength/2 * Math.sqrt(2), y + sideLength/2 * Math.sqrt(2)); 13 | square = new ObsSquare(x, y, sideLength, width); 14 | circle = new ObsCircle(x, y, (sideLength - 2 * width)/2 - 3 , width); 15 | circle.destroyStar(); 16 | circle.mirrorY(); 17 | circle.rotate(45); 18 | } 19 | 20 | @Override 21 | public void refresh(GraphicsContext graphicsContext) { 22 | square.refresh(graphicsContext); 23 | circle.refresh(graphicsContext); 24 | } 25 | 26 | @Override 27 | public boolean checkCollision(Ball ball) { 28 | return square.checkCollision(ball) || circle.checkCollision(ball); 29 | } 30 | 31 | @Override 32 | public void destroy() { 33 | 34 | } 35 | 36 | @Override 37 | public String getRandomColor() { 38 | return circle.getRandomColor(); 39 | } 40 | 41 | @Override 42 | public void update(double time) { 43 | circle.update(-time); 44 | square.update(time); 45 | } 46 | 47 | @Override 48 | public void applyOffset(double offset) { 49 | super.applyOffset(offset); 50 | circle.applyOffset(offset); 51 | square.applyOffset(offset); 52 | } 53 | 54 | @Override 55 | public boolean checkCollisionStar(Ball ball) { 56 | return square.checkCollisionStar(ball); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsTriangle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.util.Pair; 5 | import gameEngine.util.Renderer; 6 | import gameEngine.gameElements.Star; 7 | import javafx.scene.canvas.GraphicsContext; 8 | import javafx.scene.paint.Color; 9 | import java.util.ArrayList; 10 | import java.util.Random; 11 | 12 | @SuppressWarnings("ALL") 13 | public class ObsTriangle extends Obstacle { 14 | private final double width; 15 | private final double sideLength; 16 | private double rotationAngle; 17 | private final ArrayList colors = new ArrayList<>() 18 | {{ 19 | add("F6DF0E"); 20 | add("8E11FE"); 21 | add("32E1F4"); 22 | }}; 23 | 24 | public ObsTriangle(double x, double y, double sideLength, double width) { 25 | super(x, y, y - sideLength / Math.sqrt(3), y + sideLength/Math.sqrt(3)); 26 | this.width = width; 27 | this.sideLength = sideLength; 28 | star = new Star(x, y); 29 | } 30 | 31 | @Override 32 | public void refresh(GraphicsContext graphicsContext) { 33 | if (star != null) { 34 | star.refresh(graphicsContext); 35 | } 36 | graphicsContext.translate(getX(), getY()); 37 | graphicsContext.rotate(-rotationAngle); 38 | 39 | double topX, topY; 40 | double bottomLeftX, bottomLeftY; 41 | topX = 0; 42 | topY = -sideLength/Math.sqrt(3); 43 | bottomLeftX = -sideLength/2; 44 | bottomLeftY = +sideLength/(2 * Math.sqrt(3)); 45 | 46 | Renderer.drawRotatedRoundRect(topX, topY, 5, 0, sideLength - 10, width, width, width, -60, Color.web(colors.get(0))); 47 | 48 | Renderer.drawRotatedRoundRect(topX, topY, 5, -width, sideLength - 10, width, width, width, -120, Color.web(colors.get(1))); 49 | 50 | Renderer.drawRotatedRoundRect(bottomLeftX, bottomLeftY, 5, -width, sideLength - 10, width, width, width, 0, Color.web(colors.get(2))); 51 | 52 | Renderer.drawRotatedRoundRect(topX, topY, sideLength/2, 0, sideLength/2 - 5, width, width, width, -60, Color.web(colors.get(0))); 53 | 54 | 55 | // for debugging 56 | // double xx = Renderer.rotateX(topX, topY, 120); 57 | // double yy = Renderer.rotateY(topX, topY, 120); 58 | // graphicsContext.strokeLine(topX, topY, xx, yy); 59 | // topX = xx; topY = yy; 60 | // 61 | // xx = Renderer.rotateX(topX, topY, 120); 62 | // yy = Renderer.rotateY(topX, topY, 120); 63 | // graphicsContext.strokeLine(topX, topY, xx, yy); 64 | // 65 | // topX = xx; topY = yy; 66 | // xx = Renderer.rotateX(topX, topY, 120); 67 | // yy = Renderer.rotateY(topX, topY, 120); 68 | // graphicsContext.strokeLine(topX, topY, xx, yy); 69 | // end debugging 70 | 71 | 72 | graphicsContext.rotate(rotationAngle); 73 | graphicsContext.translate(-getX(), -getY()); 74 | } 75 | 76 | 77 | @Override 78 | public void update(double time) { 79 | rotationAngle += rotationalSpeed * time; 80 | while(rotationAngle < 0) { 81 | rotationAngle += 360; 82 | } 83 | rotationAngle %= 360; 84 | } 85 | 86 | @Override 87 | public boolean checkCollision(Ball ball) { 88 | 89 | double X = 0; 90 | double Y = -sideLength/(Math.sqrt(3)); 91 | 92 | double angle = rotationAngle; 93 | ArrayList points = new ArrayList<>(); 94 | 95 | for (int i = 0; i < 3; ++i) { 96 | Pair point = new Pair(0, 0); 97 | point.first = Renderer.rotateX(X, Y, angle) + getX(); 98 | point.second = Renderer.rotateY(X, Y, angle) + getY(); 99 | points.add(point); 100 | angle += 120; 101 | angle %= 360; 102 | } 103 | 104 | boolean insideBigger = false; 105 | 106 | double p1, p2; 107 | for (int i = 0; i < 360; i += 2) { 108 | p1 = Renderer.rotateX(0, -ball.getRadius(), i) + ball.getX(); 109 | p2 = Renderer.rotateY(0, -ball.getRadius(), i) + ball.getY(); 110 | insideBigger |= Renderer.checkInside(points, p1, p2); 111 | } 112 | 113 | points = new ArrayList<>(); 114 | 115 | X = 0; 116 | Y = -sideLength/(Math.sqrt(3)) + width * 2; 117 | for (int i = 0; i < 3; ++i) { 118 | Pair point = new Pair(0, 0); 119 | point.first = Renderer.rotateX(X, Y, angle) + getX(); 120 | point.second = Renderer.rotateY(X, Y, angle) + getY(); 121 | points.add(point); 122 | angle += 120; 123 | angle %= 360; 124 | } 125 | 126 | boolean insideSmaller = true; 127 | 128 | for (int i = 0; i < 360; i += 2) { 129 | p1 = Renderer.rotateX(0, -ball.getRadius(), i) + ball.getX(); 130 | p2 = Renderer.rotateY(0, -ball.getRadius(), i) + ball.getY(); 131 | insideSmaller &= Renderer.checkInside(points, p1, p2); 132 | } 133 | boolean isCollided = false; 134 | if (insideBigger && !insideSmaller) { 135 | if (ball.getY() < getY()) { 136 | if (rotationAngle > 0 && rotationAngle < 120) { 137 | isCollided = checkNotEqual(colors.get(0), ball.getColor()); 138 | } 139 | if (rotationAngle > 120 && rotationAngle < 240) { 140 | isCollided |= checkNotEqual(colors.get(2), ball.getColor()); 141 | } 142 | if (rotationAngle > 240 && rotationAngle < 360){ 143 | isCollided |= checkNotEqual(colors.get(1), ball.getColor()); 144 | } 145 | } else { 146 | if (rotationAngle < 60 || rotationAngle > 300) { 147 | isCollided = checkNotEqual(colors.get(2), ball.getColor()); 148 | } 149 | if (rotationAngle > 60 && rotationAngle < 180) { 150 | isCollided |= checkNotEqual(colors.get(1), ball.getColor()); 151 | } 152 | if (rotationAngle > 180 && rotationAngle < 300){ 153 | isCollided |= checkNotEqual(colors.get(0), ball.getColor()); 154 | } 155 | } 156 | } 157 | return isCollided; 158 | } 159 | 160 | @Override 161 | public void destroy() { 162 | 163 | } 164 | 165 | public ArrayList getColors() { 166 | return colors; 167 | } 168 | 169 | @Override 170 | public String getRandomColor() { 171 | Random random = new Random(); 172 | return colors.get(random.nextInt(colors.size())); 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/ObsTripleCircle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | 6 | import java.util.ArrayList; 7 | 8 | public class ObsTripleCircle extends ObsCircle { 9 | 10 | 11 | private final ArrayList circles; 12 | 13 | public ObsTripleCircle(double x, double y, double innerInnerRadius, double innerRadius, double outerRadius, double width) { 14 | super(x, y, outerRadius, width); 15 | super.destroyStar(); 16 | circles = new ArrayList<>(); 17 | circles.add(new ObsCircle(x, y, outerRadius, width)); 18 | circles.add(new ObsCircle(x, y, innerRadius, width)); 19 | circles.add(new ObsCircle(x, y, innerInnerRadius, width)); 20 | circles.get(0).destroyStar(); 21 | circles.get(1).destroyStar(); 22 | circles.get(1).mirrorY(); 23 | for (ObsCircle circle : circles) { 24 | circle.setRotationAngle(45); 25 | } 26 | } 27 | 28 | @Override 29 | public void refresh(GraphicsContext graphicsContext) { 30 | for (ObsCircle obsCircle : circles) { 31 | obsCircle.refresh(graphicsContext); 32 | } 33 | } 34 | 35 | @Override 36 | public boolean checkCollision(Ball ball) { 37 | boolean isCollided = false; 38 | for (ObsCircle obsCircle : circles) { 39 | isCollided |= obsCircle.checkCollision(ball); 40 | } 41 | return isCollided; 42 | } 43 | 44 | @Override 45 | public void rotate(double angle) { 46 | for (ObsCircle circle : circles) { 47 | circle.rotate(angle); 48 | } 49 | } 50 | 51 | @Override 52 | public boolean checkCollisionStar(Ball ball) { 53 | boolean isCollided = false; 54 | for (ObsCircle obsCircle : circles) { 55 | isCollided |= obsCircle.checkCollisionStar(ball); 56 | } 57 | return isCollided; 58 | } 59 | 60 | @Override 61 | public void applyOffset(double offset) { 62 | super.applyOffset(offset); 63 | for (ObsCircle obsCircle : circles) { 64 | obsCircle.applyOffset(offset); 65 | } 66 | } 67 | 68 | @Override 69 | public void destroy() { 70 | 71 | } 72 | 73 | @Override 74 | public String getRandomColor() { 75 | return circles.get(0).getRandomColor(); 76 | } 77 | 78 | @Override 79 | public void update(double time) { 80 | for (ObsCircle obsCircle : circles) { 81 | obsCircle.update(time); 82 | time *= -1; 83 | } 84 | } 85 | 86 | @Override 87 | public ObsCircle generateNext() { 88 | return new ObsTripleCircle(x, y - 2 * radius - 5, circles.get(2).radius, circles.get(1).radius, circles.get(0).radius, radius - innerRadius); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/gameEngine/gameElements/obstacles/Obstacle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.gameElements.obstacles; 2 | 3 | import gameEngine.Ball; 4 | import gameEngine.gameElements.GameElement; 5 | import gameEngine.gameElements.Star; 6 | 7 | public abstract class Obstacle extends GameElement { 8 | 9 | protected double translationSpeed; 10 | protected double rotationalSpeed; 11 | protected double closestStar = 0; 12 | protected Star star; 13 | private boolean isCrossed; 14 | public double getClosestStar() { 15 | return closestStar; 16 | } 17 | 18 | public void setTranslationSpeed(double translationSpeed) { 19 | this.translationSpeed = translationSpeed; 20 | } 21 | 22 | public void setRotationalSpeed(double rotationalSpeed) { 23 | this.rotationalSpeed = rotationalSpeed; 24 | } 25 | 26 | public Obstacle(double x, double y, double topY, double bottomY) { 27 | super(x, y, topY, bottomY); 28 | rotationalSpeed = 90; 29 | audioClipPath = "src/assets/music/gameplay/dead.wav"; 30 | this.loadAssets(); // need to ensure that audio clip path has been set 31 | isCrossed = false; 32 | } 33 | 34 | public boolean isCrossed() { 35 | return isCrossed; 36 | } 37 | 38 | public void setCrossed() { 39 | isCrossed = true; 40 | } 41 | 42 | public abstract String getRandomColor(); 43 | 44 | public abstract void update(double time); 45 | 46 | public boolean checkNotEqual(String a, String b) { 47 | return !a.equals(b); 48 | } 49 | 50 | public boolean checkCollisionStar(Ball ball) { 51 | if (star == null) { 52 | return false; 53 | } 54 | boolean isCollided = star.checkCollision(ball); 55 | if (isCollided) { 56 | star.playSound(); 57 | destroyStar(); 58 | } 59 | return isCollided; 60 | } 61 | 62 | @Override 63 | public void applyOffset(double offset) { // all concatenated obstacles, need to call super 64 | if (star != null) { 65 | star.applyOffset(offset); 66 | } 67 | super.applyOffset(offset); 68 | } 69 | 70 | public Star getStar() { // need for reloading assets 71 | return this.star; 72 | } 73 | 74 | public void destroyStar() { 75 | star = null; 76 | } 77 | 78 | public int getMaxCount() { 79 | return 1; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/gameEngine/swarm/Particle.java: -------------------------------------------------------------------------------- 1 | package gameEngine.swarm; 2 | 3 | import gameEngine.GamePlay; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import javafx.scene.paint.Color; 6 | 7 | public class Particle { 8 | 9 | public double x, y; 10 | private final GraphicsContext graphicsContext; 11 | private final double radius; 12 | private double Vx, Vy; 13 | private final double gravity = 1700; 14 | private final String color; 15 | Particle(double x, double y, double radius, double Vx, double Vy, GraphicsContext graphicsContext, String color) { 16 | this.x = x; 17 | this.y = y; 18 | this.radius = radius; 19 | this.graphicsContext = graphicsContext; 20 | this.Vx = Vx; 21 | this.Vy = Vy; 22 | this.color = color; 23 | } 24 | 25 | public void refresh() { 26 | graphicsContext.setFill(Color.web(color)); 27 | graphicsContext.fillOval(x - radius, y - radius, 2 * radius, 2 * radius); 28 | } 29 | 30 | public double move(double time) { 31 | double distanceX = Vx * time; 32 | double distanceY = Vy * time + (gravity * time * time)/2; 33 | y += distanceY; 34 | x += distanceX; 35 | Vy += gravity * time; 36 | if (x < radius) { 37 | x = radius; 38 | Vx *= -1; 39 | }else if (x > GamePlay.WIDTH - radius) { 40 | x = GamePlay.WIDTH - radius; 41 | Vx *= -1; 42 | } 43 | return 0; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/gameEngine/swarm/Swarm.java: -------------------------------------------------------------------------------- 1 | package gameEngine.swarm; 2 | 3 | import gameEngine.Ball; 4 | import javafx.scene.canvas.GraphicsContext; 5 | import java.util.ArrayList; 6 | import java.util.Random; 7 | 8 | public class Swarm { 9 | 10 | ArrayList particles; 11 | private final int numberOfParticles = 41; 12 | private final GraphicsContext graphicsContext; 13 | 14 | private final ArrayList colors = new ArrayList<>() 15 | {{ 16 | add("F6DF0E"); 17 | add("8E11FE"); 18 | add("32E1F4"); 19 | add("FD0082"); 20 | }}; 21 | 22 | public Swarm(GraphicsContext graphicsContext) { 23 | particles = new ArrayList<>(); 24 | this.graphicsContext = graphicsContext; 25 | } 26 | 27 | public void explode(Ball ball) { 28 | Random random = new Random(); 29 | int radius; 30 | double x = ball.getX(), y = ball.getY(); 31 | double Vx, Vy; 32 | int va; 33 | String color; 34 | for (int i = 0; i < numberOfParticles - 1; ++i) { 35 | radius = random.nextInt(4) + 2; 36 | Vx = random.nextInt(500); 37 | Vy = random.nextInt(1200); 38 | color = getRandomColor(); 39 | va = i/(numberOfParticles/4); 40 | if (va == 1) { 41 | Vx *= -1; 42 | }else if (va == 2) { 43 | Vx *= -1; 44 | Vy *= -1; 45 | }else { 46 | Vy *= -1; 47 | } 48 | Particle particle = new Particle(x, y, radius, Vx, Vy, graphicsContext, color); 49 | particles.add(particle); 50 | } 51 | } 52 | 53 | public void update(double time) { 54 | for (Particle particle : particles) { 55 | particle.move(time); 56 | } 57 | } 58 | 59 | public void refresh() { 60 | for (Particle particle : particles) { 61 | particle.refresh(); 62 | } 63 | } 64 | 65 | public String getRandomColor() { 66 | Random random = new Random(); 67 | return colors.get(random.nextInt(colors.size())); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/gameEngine/util/Database.java: -------------------------------------------------------------------------------- 1 | package gameEngine.util; 2 | 3 | import java.io.*; 4 | import java.util.ArrayList; 5 | import java.util.Collections; 6 | 7 | @SuppressWarnings({"rawtypes", "unchecked"}) 8 | public class Database { 9 | 10 | private final int MAX_SIZE = 6; // number of records to store in arraylist 11 | private final ArrayList data; 12 | 13 | public Database() { 14 | this.data = new ArrayList<>(); 15 | } 16 | 17 | public void form(String path) { 18 | try { 19 | ObjectInputStream in = new ObjectInputStream(new FileInputStream(path)); 20 | ArrayList temp = (ArrayList) in.readObject(); 21 | for (Object obj : temp) { 22 | this.data.add((T) obj); 23 | } 24 | System.out.println(this.getClass().toString()); 25 | System.out.println(this.data.size()); 26 | for (T t : this.data) 27 | System.out.println(t); 28 | 29 | assert (this.data.size() <= MAX_SIZE); 30 | } catch (IOException | ClassNotFoundException e) { 31 | System.out.println(this.getClass().toString() + " failed to form database"); 32 | System.out.println(e.toString()); 33 | } 34 | } 35 | 36 | public void save(String path) { 37 | try { 38 | ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(path)); 39 | System.out.println(this.getClass().toString() + " sz data: " + this.data.size()); 40 | out.writeObject(this.data); 41 | } catch (IOException e) { 42 | System.out.println(this.getClass().toString() + " save failed"); 43 | System.out.println(e.toString()); 44 | } 45 | } 46 | 47 | public boolean update(T entity, String path) { // updates and calls save and returns true in case of overwrite 48 | boolean ret = this.data.size() == MAX_SIZE; 49 | ArrayList temp = new ArrayList<>(); 50 | for (T t : this.data) 51 | temp.add((Comparable) t); 52 | temp.add((Comparable) entity); 53 | Collections.sort(temp); 54 | this.data.clear(); 55 | for (int cnt = 0; cnt < Math.min(temp.size(), MAX_SIZE); ++ cnt) 56 | this.data.add((T) temp.get(cnt)); 57 | assert (this.data.size() <= MAX_SIZE); 58 | this.save(path); 59 | return ret; // overwrite 60 | } 61 | 62 | public ArrayList getData() { 63 | return data; 64 | } 65 | 66 | public void reset(String path) { 67 | this.data.clear(); 68 | this.save(path); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/gameEngine/util/Pair.java: -------------------------------------------------------------------------------- 1 | package gameEngine.util; 2 | 3 | public class Pair { 4 | 5 | public double first; 6 | public double second; 7 | 8 | public Pair(double first, double second) { 9 | this.first = first; 10 | this.second = second; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/gameEngine/util/Renderer.java: -------------------------------------------------------------------------------- 1 | package gameEngine.util; 2 | 3 | import gameEngine.GamePlay; 4 | import gameEngine.util.Pair; 5 | import javafx.scene.canvas.GraphicsContext; 6 | import javafx.scene.paint.Color; 7 | import javafx.scene.shape.FillRule; 8 | 9 | import java.util.ArrayList; 10 | 11 | public final class Renderer { 12 | 13 | public final static int WIDTH = 450; 14 | public final static int HEIGHT = 700; 15 | private static GraphicsContext graphicsContext; 16 | 17 | // to handle gui components 18 | public static void init(GraphicsContext gc) { 19 | graphicsContext = gc; 20 | } 21 | 22 | public static boolean checkInside(ArrayList points, double p1, double p2) { 23 | // points : An arrayList of points in clockwise Order 24 | // add first again for full circular order 25 | Pair first = points.get(0); 26 | points.add(first); 27 | double areaByPoint = 0; 28 | double area = 0; 29 | Pair prevPoint = null; 30 | for (Pair point : points) { 31 | if (prevPoint == null) { 32 | prevPoint = point; 33 | continue; 34 | } 35 | Pair vector = new Pair(prevPoint.first - point.first, prevPoint.second - point.second); 36 | areaByPoint += crossProduct(vector.first, vector.second, p1 - point.first, p2 - point.second)/2; 37 | area += crossProduct(vector.first, vector.second, first.first - point.first, first.second - point.second)/2; 38 | prevPoint = point; 39 | } 40 | return Math.abs(areaByPoint - area) < 0.001; 41 | } 42 | 43 | public static double crossProduct(double x, double y, double a, double b) { 44 | return Math.abs(x * b - y * a); 45 | } 46 | 47 | public static double rotateX(double x, double y, double angle) { 48 | double angleRadians = angle * (Math.PI/180); 49 | double newX = x * Math.cos(angleRadians) - y * Math.sin(angleRadians); 50 | return newX; 51 | } 52 | 53 | public static double rotateY(double x, double y, double angle) { 54 | double angleRadians = angle * (Math.PI/180); 55 | double newY = x * Math.sin(angleRadians) + y * Math.cos(angleRadians); 56 | return newY; 57 | } 58 | 59 | public static void drawRotatedRoundRect(double pivotX, double pivotY, double x, double y, double width, double height, double arcWidth, double arcHeight, double angle, Color color) { 60 | graphicsContext.translate(pivotX, pivotY); 61 | graphicsContext.rotate(-angle); 62 | graphicsContext.setFill(color); 63 | graphicsContext.fillRoundRect(x, y, width, height, arcHeight, arcHeight); 64 | graphicsContext.rotate(angle); 65 | graphicsContext.translate(-pivotX, -pivotY); 66 | } 67 | 68 | // draw rectangle that curves around screen 69 | public static void drawFoldingRed(double topLeftX, double topLeftY, double width, double length, Color color) { 70 | 71 | graphicsContext.setFill(color); 72 | graphicsContext.fillRect(topLeftX, topLeftY, width, length); 73 | if (topLeftX + width > WIDTH) { 74 | graphicsContext.fillRect(0,topLeftY, topLeftX + width - WIDTH, length); 75 | } 76 | 77 | } 78 | 79 | public static void drawDashedLine(double x, double y, double width, double dashLength, double gap, Color color) { 80 | graphicsContext.setStroke(color); 81 | graphicsContext.setLineWidth(width); 82 | graphicsContext.setLineDashes(2); 83 | for (double i = x; i < GamePlay.WIDTH; ++i) { 84 | graphicsContext.strokeLine(i, y, i + dashLength, y); 85 | i += dashLength; 86 | i += gap; 87 | } 88 | } 89 | 90 | public static void drawArc(double centerX, double centerY, double radius, double innerRadius, Color bgColor, Color strokeColor, int angle) { 91 | 92 | graphicsContext.beginPath(); 93 | graphicsContext.setFill(bgColor); 94 | graphicsContext.setStroke(strokeColor); 95 | graphicsContext.setLineWidth(1); 96 | graphicsContext.setFillRule(FillRule.EVEN_ODD); 97 | 98 | double shiftedX = centerX + innerRadius; 99 | double shiftedY = centerY; 100 | double tShiftedX, tShiftedY; 101 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 102 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 103 | graphicsContext.moveTo(tShiftedX, tShiftedY); 104 | 105 | double pivotX; 106 | shiftedX = centerX; 107 | shiftedY = centerY - innerRadius; 108 | pivotX = centerX + innerRadius; 109 | double pivotY = centerY - innerRadius; 110 | double tPivotX = transformX(pivotX, pivotY, centerX, centerY, angle); 111 | double tPivotY = transformY(pivotX, pivotY, centerX, centerY, angle); 112 | 113 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 114 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 115 | graphicsContext.arcTo(tPivotX, tPivotY, tShiftedX, tShiftedY, innerRadius); 116 | 117 | shiftedX = centerX + innerRadius; 118 | shiftedY = centerY; 119 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 120 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 121 | graphicsContext.moveTo(tShiftedX, tShiftedY); 122 | 123 | shiftedX = centerX + radius; 124 | shiftedY = centerY; 125 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 126 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 127 | graphicsContext.lineTo(tShiftedX, tShiftedY); 128 | 129 | pivotX = shiftedX; 130 | pivotY = shiftedY - radius; 131 | shiftedX = centerX; 132 | shiftedY = centerY - radius; 133 | tPivotX = transformX(pivotX, pivotY, centerX, centerY, angle); 134 | tPivotY = transformY(pivotX, pivotY, centerX, centerY, angle); 135 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 136 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 137 | graphicsContext.arcTo(tPivotX, tPivotY, tShiftedX, tShiftedY, radius); 138 | 139 | shiftedX = centerX; 140 | shiftedY = centerY - innerRadius; 141 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 142 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 143 | graphicsContext.lineTo(tShiftedX, tShiftedY); 144 | 145 | shiftedX = centerX + innerRadius; 146 | shiftedY = centerY; 147 | tShiftedX = transformX(shiftedX, shiftedY, centerX, centerY, angle); 148 | tShiftedY = transformY(shiftedX, shiftedY, centerX, centerY, angle); 149 | graphicsContext.moveTo(tShiftedX, tShiftedY); 150 | graphicsContext.closePath(); 151 | graphicsContext.stroke(); 152 | graphicsContext.fill(); 153 | } 154 | 155 | private static double transformX(double x, double y, double centerX, double centerY, int angle) { 156 | double xx = x - centerX; 157 | double yy = y - centerY; 158 | if (angle == 0) { 159 | return xx + centerX; 160 | }else if (angle == 1) { 161 | return yy + centerX; 162 | }else if (angle == 2) { 163 | return -xx + centerX; 164 | } 165 | return -yy + centerX; 166 | } 167 | 168 | private static double transformY(double x, double y, double centerX, double centerY, int angle) { 169 | double xx = x - centerX; 170 | double yy = y - centerY; 171 | if (angle == 0) { 172 | return yy + centerY; 173 | }else if (angle == 1) { 174 | return -xx + centerY; 175 | }else if (angle == 2) { 176 | return -yy + centerY; 177 | } 178 | return xx + centerY; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/gui/Dialog.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/gui/Dialog.java: -------------------------------------------------------------------------------- 1 | package gui; 2 | 3 | import gameEngine.GamePlay; 4 | import javafx.animation.*; 5 | import javafx.fxml.FXMLLoader; 6 | import javafx.geometry.Rectangle2D; 7 | import javafx.scene.Parent; 8 | import javafx.scene.Scene; 9 | import javafx.scene.control.Label; 10 | import javafx.scene.paint.Color; 11 | import javafx.stage.Modality; 12 | import javafx.stage.Screen; 13 | import javafx.stage.Stage; 14 | import javafx.stage.StageStyle; 15 | import javafx.util.Duration; 16 | 17 | import java.io.IOException; 18 | 19 | // for popups like confirmations and stuff 20 | public class Dialog { // TODO location of stage 21 | 22 | public Dialog(String msg, Stage primaryStage) { 23 | FXMLLoader loader = new FXMLLoader(getClass().getResource("Dialog.fxml")); 24 | Parent dialogRoot = null; 25 | try { 26 | dialogRoot = loader.load(); 27 | } catch (IOException e) { 28 | System.out.println(this.getClass().toString() + " failed to load dialog root"); 29 | e.printStackTrace(); 30 | } 31 | assert (dialogRoot != null); 32 | 33 | Label msgLabel = (Label) dialogRoot.getChildrenUnmodifiable().get(1); 34 | msgLabel.setText(msg); 35 | 36 | Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds(); 37 | 38 | Scene scene = new Scene(dialogRoot); 39 | scene.setFill(Color.TRANSPARENT); 40 | Stage secondaryStage = new Stage(StageStyle.TRANSPARENT); 41 | secondaryStage.initModality(Modality.NONE); 42 | secondaryStage.initOwner(primaryStage); 43 | secondaryStage.setScene(scene); 44 | secondaryStage.show(); 45 | 46 | System.out.println(this.getClass().toString() + " focused secondaryStage before: " + secondaryStage.isFocused()); 47 | dialogRoot.setFocusTraversable(false); 48 | primaryStage.requestFocus(); 49 | System.out.println(this.getClass().toString() + " focused secondaryStage after: " + secondaryStage.isFocused()); 50 | System.out.println(this.getClass().toString() + " focused prim stage: " + primaryStage.isFocused()); 51 | 52 | secondaryStage.setX((primScreenBounds.getWidth() - secondaryStage.getWidth()) / 2); 53 | secondaryStage.setY(GamePlay.HEIGHT + secondaryStage.getHeight() / 3.25 + 1); 54 | System.out.println(this.getClass().toString() + " secondary stage: " + secondaryStage.getX() + ", " + secondaryStage.getY()); 55 | 56 | dialogRoot.setOpacity(0.0); 57 | FadeTransition exitAnim = new FadeTransition(Duration.seconds(0.75), dialogRoot); 58 | exitAnim.setToValue(0.0); 59 | exitAnim.setOnFinished(t -> secondaryStage.close()); 60 | PauseTransition delay = new PauseTransition(Duration.seconds(1.25)); 61 | delay.setOnFinished(t -> exitAnim.play()); 62 | FadeTransition showAnim = new FadeTransition(Duration.seconds(0.75), dialogRoot); 63 | showAnim.setToValue(1); 64 | showAnim.setOnFinished(t -> delay.play()); 65 | showAnim.play(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/gui/GamePlay.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/gui/GamePlayController.java: -------------------------------------------------------------------------------- 1 | package gui; 2 | 3 | import gameEngine.App; 4 | import gameEngine.GamePlay; 5 | import javafx.animation.AnimationTimer; 6 | import javafx.animation.PauseTransition; 7 | import javafx.fxml.FXML; 8 | import javafx.fxml.FXMLLoader; 9 | import javafx.scene.Scene; 10 | import javafx.scene.control.Button; 11 | import javafx.scene.input.KeyEvent; 12 | import javafx.scene.layout.AnchorPane; 13 | import javafx.scene.layout.StackPane; 14 | import javafx.scene.paint.Paint; 15 | import javafx.scene.shape.Circle; 16 | import javafx.scene.shape.Rectangle; 17 | import javafx.stage.Stage; 18 | import javafx.util.Duration; 19 | 20 | import java.io.IOException; 21 | 22 | public class GamePlayController { 23 | 24 | private App app; 25 | private GamePlay gamePlay; 26 | private Boolean paused; 27 | private AnchorPane pausePane; 28 | private PauseOverlayController pauseOverlayController; 29 | 30 | @FXML 31 | private AnchorPane gamePlayRoot; 32 | @FXML 33 | private Button button; 34 | @FXML 35 | private Circle glowCircle; 36 | 37 | public void init(GamePlay _gamePlay, App _app) throws IOException { 38 | System.out.println(this.getClass().toString() + " gameplay instantiated"); 39 | this.app = _app; 40 | this.gamePlay = _gamePlay; 41 | 42 | FXMLLoader loader = new FXMLLoader(getClass().getResource("PauseOverlay.fxml")); 43 | this.pausePane = loader.load(); 44 | this.pauseOverlayController = loader.getController(); 45 | 46 | this.button.setStyle("-fx-background-radius: 200px; -fx-background-color: #808588"); 47 | this.paused = false; 48 | } 49 | @FXML 50 | public void pauseHoverActive() { 51 | this.button.setScaleX(1.1); 52 | this.button.setScaleY(1.1); 53 | this.button.setStyle("-fx-background-radius: 200px; -fx-background-color: #555555"); 54 | } 55 | @FXML 56 | public void pauseHoverInactive() { 57 | this.button.setScaleX(1); 58 | this.button.setScaleY(1); 59 | this.button.setStyle("-fx-background-radius: 200px; -fx-background-color: #808588"); 60 | } 61 | @FXML 62 | public void pausePressed() { // most probably have to serialize here to pause (Naah but might use if saved from there), focus shifts to button (IMP) 63 | AnimationTimer animationTimer = this.gamePlay.getAnimationTimer(); 64 | Scene scene = this.button.getScene(); 65 | StackPane rootContainer = (StackPane) scene.getRoot(); 66 | assert (rootContainer.getChildren().size() == 1); 67 | assert (!this.paused); 68 | System.out.println(this.getClass().toString() + "Pause pressed"); 69 | 70 | this.paused = true; 71 | animationTimer.stop(); // automatically resets previous time variables 72 | this.gamePlay.getCanvas().removeEventHandler(KeyEvent.KEY_PRESSED, GamePlay.JumpEventHandler); // safe to maintain this, as focus is constantly switched 73 | rootContainer.getChildren().add(this.pausePane); 74 | this.pausePane.requestFocus(); // very very important 75 | this.pauseOverlayController.init(this, this.app); 76 | } 77 | 78 | public void unpause() { // add event handler again, and get focus 79 | Scene scene = this.button.getScene(); 80 | StackPane rootContainer = (StackPane) scene.getRoot(); 81 | AnimationTimer animationTimer = this.gamePlay.getAnimationTimer(); 82 | 83 | this.paused = false; 84 | rootContainer.getChildren().remove(this.pausePane); 85 | assert (rootContainer.getChildren().size() == 1); 86 | 87 | // to block inputs during the pause transition 88 | Rectangle tempR = new Rectangle(); 89 | tempR.setWidth(GamePlay.WIDTH); 90 | tempR.setHeight(GamePlay.HEIGHT); 91 | tempR.setFill(Paint.valueOf("#000000")); 92 | tempR.setOpacity(0); 93 | rootContainer.getChildren().add(tempR); 94 | 95 | Stage primaryStage = (Stage) this.app.getScene().getWindow(); 96 | primaryStage.requestFocus(); // in case, overshadowed by secondary stage 97 | this.gamePlay.getCanvas().requestFocus(); // to remove focus from the pause button & regain for jump event handler, IMP 98 | PauseTransition pt = new PauseTransition(Duration.millis(600)); // for relaxation after unpause 99 | pt.setOnFinished(t -> { 100 | rootContainer.getChildren().remove(tempR); 101 | this.gamePlay.getCanvas().addEventHandler(KeyEvent.KEY_PRESSED, GamePlay.JumpEventHandler); 102 | this.gamePlay.getCanvas().requestFocus(); // just in case, rootContainer contents have changed 103 | animationTimer.start(); 104 | }); 105 | pt.play(); 106 | } 107 | 108 | public GamePlay getGamePlay() { 109 | return gamePlay; 110 | } 111 | public Boolean getPaused() { 112 | return this.paused; 113 | } 114 | public AnchorPane getGamePlayRoot() { 115 | return gamePlayRoot; 116 | } 117 | public Circle getGlowCircle() { 118 | return glowCircle; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/gui/InputPopup.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 41 | 56 | 64 | 65 | 66 | 67 | 68 | 69 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /src/gui/InputPopupController.java: -------------------------------------------------------------------------------- 1 | package gui; 2 | 3 | import gameEngine.Player; 4 | import javafx.fxml.FXML; 5 | import javafx.scene.control.Button; 6 | import javafx.scene.control.Label; 7 | import javafx.scene.control.TextField; 8 | import javafx.scene.effect.Glow; 9 | import javafx.scene.image.ImageView; 10 | import javafx.scene.media.AudioClip; 11 | import javafx.stage.Stage; 12 | 13 | import java.io.File; 14 | import java.time.LocalDate; 15 | 16 | public class InputPopupController { 17 | 18 | private T controller; 19 | private boolean saveSuccess; // in case user presses cancel 20 | private AudioClip hoverSound; 21 | private AudioClip clickSound; 22 | private AudioClip errorSound; 23 | 24 | @FXML 25 | private Button saveButton; 26 | @FXML 27 | private TextField inputField; 28 | @FXML 29 | private Label headingLabel; 30 | @FXML 31 | private Label bottomLabel; 32 | @FXML 33 | private Label scoreLabel; 34 | @FXML 35 | private Label distLabel; 36 | @FXML 37 | private Label jumpsLabel; 38 | @FXML 39 | private ImageView crossButton; 40 | 41 | 42 | public void init(Player player, T _controller) { // don't modify player here at all 43 | 44 | this.saveSuccess = false; 45 | 46 | this.hoverSound = new AudioClip(new File("src/assets/music/mouse/hover.wav").toURI().toString()); 47 | this.clickSound = new AudioClip(new File("src/assets/music/mouse/button.wav").toURI().toString()); 48 | this.errorSound = new AudioClip(new File("src/assets/music/mouse/error.wav").toURI().toString()); 49 | this.clickSound.setVolume(0.5); // add click sounds 50 | this.errorSound.setVolume(0.4); 51 | this.hoverSound.setVolume(0.03); 52 | 53 | this.saveButton.setStyle("-fx-background-color: #ffd300, linear-gradient(yellow 50%, #ffd300 100%), radial-gradient(center 50% -40%, radius 200%, yellow 45%, #ffd300 50%); -fx-background-radius : 20"); 54 | 55 | this.controller = _controller; 56 | if (this.controller instanceof PauseOverlayController) { 57 | this.headingLabel.setText("Save Game"); 58 | Glow glow = (Glow) this.bottomLabel.getEffect(); 59 | glow.setLevel(0.0); 60 | this.bottomLabel.setText("Date: " + LocalDate.now().toString()); 61 | } else { // see for leaderboard 62 | this.headingLabel.setText("Leaderboard Entry"); 63 | this.bottomLabel.setText("Claim your spot among the top!"); 64 | if (player.getId() != -1) { // if saved, prompt to put previous name 65 | inputField.setText(player.getName()); 66 | inputField.setPromptText(player.getName()); 67 | } 68 | } 69 | this.scoreLabel.setText("" + player.getScore()); 70 | this.distLabel.setText("" + player.getDistance()); 71 | this.jumpsLabel.setText("" + player.getJumps()); 72 | } 73 | 74 | @FXML 75 | public void saveButtonHoverActive() { 76 | this.hoverSound.play(); 77 | this.saveButton.setStyle("-fx-background-color: #ffd300, linear-gradient(yellow 50%, #ffd300 100%), radial-gradient(center 50% -40%, radius 200%, yellow 35%, #ffd300 50%); -fx-background-radius : 20"); 78 | } 79 | 80 | @FXML 81 | public void saveButtonHoverInactive() { 82 | this.saveButton.setStyle("-fx-background-color: #ffd300, linear-gradient(yellow 50%, #ffd300 100%), radial-gradient(center 50% -40%, radius 200%, yellow 45%, #ffd300 50%); -fx-background-radius : 20"); 83 | } 84 | 85 | @FXML 86 | public void crossHoverActive() { 87 | this.crossButton.setScaleX(1.15); 88 | this.crossButton.setScaleY(1.15); 89 | Glow glow = (Glow) this.crossButton.getEffect(); 90 | glow.setLevel(0.4); 91 | } 92 | 93 | @FXML 94 | public void crossHoverInactive() { 95 | this.crossButton.setScaleX(1); 96 | this.crossButton.setScaleY(1); 97 | Glow glow = (Glow) this.crossButton.getEffect(); 98 | glow.setLevel(0.0); 99 | } 100 | 101 | @FXML 102 | public void crossClicked() { 103 | this.clickSound.play(); 104 | System.out.println(this.getClass().toString() + " cross clicked"); 105 | Stage stage = (Stage) this.crossButton.getScene().getWindow(); 106 | stage.close(); 107 | } 108 | 109 | @FXML 110 | public void buttonPressed() { 111 | String name = this.inputField.getText(); 112 | if (name == null || name.length() == 0) { 113 | this.errorSound.play(); 114 | this.inputField.setStyle("-fx-border-width: 2; -fx-border-color: #ffd300;"); 115 | System.out.println(this.getClass().toString() + " blank input registered"); 116 | return; 117 | } 118 | 119 | this.saveSuccess = true; 120 | this.clickSound.play(); 121 | System.out.println(this.getClass().toString() + " " + name + " registered"); 122 | 123 | if (this.controller instanceof PauseOverlayController) { 124 | ((PauseOverlayController) this.controller).setUsernameSave(name); 125 | } else { // see for leaderboard 126 | assert (this.controller instanceof GameOverPageController); 127 | ((GameOverPageController) this.controller).setUsernameLB(name); 128 | } 129 | 130 | Stage stage = (Stage) this.saveButton.getScene().getWindow(); 131 | stage.close(); 132 | } 133 | 134 | public boolean getSaveSuccess() { 135 | return this.saveSuccess; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/gui/LoadAnimation.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/gui/PauseOverlay.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | --------------------------------------------------------------------------------