A side-scrolling obstacle game built with Java and JavaFX. The player controls a character that must jump over incoming hurdles while a parallax background scrolls continuously.
- Press Up Arrow to jump over obstacles
- Score increases for each hurdle cleared
- Collision with a hurdle triggers Game Over
- Replay or return to the main menu from the Game Over screen
- Parallax Scrolling — two background images loop seamlessly for infinite scrolling
- Collision Detection — real-time bounds intersection checks between character and hurdles
- Sound Effects — jump, duck, and game-over audio cues with background music
- Animated Intro — sequential scale transitions on menu elements
- Multiple Screens — intro menu, game screen, settings, credits, and game-over with replay
- Keyboard Controls — arrow key input handling for character movement
src/main/java/com/example/jumpgame/
├── HelloApplication.java # Entry point — launches the intro screen
├── Introscreen.java # Main menu with Play, Settings, Credits, Quit
├── GameScreen.java # Core game loop — scrolling, hurdles, scoring, collision
├── settingScene.java # Settings screen (placeholder)
└── creditScene.java # Credits screen
The game uses JavaFX Timeline animations:
- Background movement — 30ms keyframes shift two tiled images left; when one exits the viewport it repositions behind the other
- Hurdle spawning — new obstacles appear every 5 seconds at the right edge and move left
- Jump mechanic — character Y-position shifts up instantly, then returns after 700ms
- Java 17+
- Maven 3.8+
mvn clean javafx:runPlace your own .wav files in src/main/resources/:
jump.wav— played on jumpducking.wav— played on duckdeath 2.wav— played on game over- Background music
.wav— looped during gameplay