A simple 2D Java game where the player moves forward while dodging falling spiders. If a spider hits the player, the game ends with a โGame Overโ message. Reach the right end of the screen to win the game. A โRestartโ button allows the player to replay the game.
player.gif, spider.gif, GameBg.jpg).โโโ GameFrame.java # Main class to launch the game โโโ Board.java # Game logic and rendering โโโ Player.java # Player movement and drawing โโโ Spider.java # Spider movement and collision logic โโโ GameBg.jpg # Background image โโโ player.gif # Player image โโโ spider.gif # Spider image
๐ง Concepts Used Java Swing (JFrame, JPanel, JButton)
Event Handling (keyboard + button)
Timers and Animation
Collision Detection (Rectangle intersection)
Object-Oriented Programming
start
Win
gameover