Game_In_Java

๐Ÿ•น๏ธ Escape the Spider - Java 2D Game

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.

๐ŸŽฎ Game Features

๐Ÿ“ Project Structure

โ”œโ”€โ”€ 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 WhatsApp Image 2025-08-02 at 05 54 54_1b67cf83 Win image gameover image