Skip to content
fvlgaPublic

About

Side-scrolling obstacle game with JavaFX — parallax scrolling, collision detection, sound effects, and animated menus

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Jump Game

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.

Java JavaFX Maven

Gameplay

  • 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

Features

  • 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

Architecture

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

Game Loop Design

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

Setup

Prerequisites

  • Java 17+
  • Maven 3.8+

Run

mvn clean javafx:run

Audio

Place your own .wav files in src/main/resources/:

  • jump.wav — played on jump
  • ducking.wav — played on duck
  • death 2.wav — played on game over
  • Background music .wav — looped during gameplay

About

Side-scrolling obstacle game with JavaFX — parallax scrolling, collision detection, sound effects, and animated menus

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages