Dodge A Block is an engaging Java-based arcade-style game where the player controls a character and attempts to dodge obstacles while collecting coins to earn points. The game features a dynamic camera, collision mechanics, and gravity simulation for realistic movement.
- Dynamic Gameplay: Control the player using space key to avoid walls and collect coins.
- Gravity and Collision Mechanics: Realistic physics to enhance gameplay experience.
- Points System: Earn points by collecting coins scattered throughout the game.
- Reset Mechanism: Automatic reset if the player falls out of bounds.
- Simple Visual Design: A clean and straightforward user interface.
Watch the gameplay demo on YouTube.
- Clone this repository:
git clone https://github.com/yourusername/dodge-a-block.git
- Navigate to the project directory:
cd dodge-a-block - Compile the project:
javac *.java - Run the main application:
java App
public class Player {
GamePanel panel;
int x, y, width, height;
double xspeed, yspeed;
Rectangle hitBox;
int points = 0;
public Player(int x, int y, GamePanel panel) {
this.panel = panel;
this.x = x;
this.y = y;
width = 75;
height = 75;
hitBox = new Rectangle(x, y, width, height);
}
public void set() {
// Movement and collision logic
}
public void drawRight(Graphics2D gtd) {
gtd.setColor(Color.BLACK);
gtd.fillRect(x, y, width, height);
}
}- Java: Core programming language.
- Swing and AWT: For GUI and rendering.
- YouTube: Hosting the demo video.
- Add sound effects and background music.
- Add scoreboard
- Random Terrain Gen
- Introduce new levels with increasing difficulty.
- Implement additional obstacles and power-ups.
Happy Gaming!