Skip to content

TaherJoudeh/Square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Square - Dodge & Survive

Java License: MIT Release

A fast-paced arcade dodge game built in Java where survival is everything. Dodge falling enemies, collect power-ups, and compete for the highest score!

Built during 11th grade as a passion project to learn game development and Java programming.


๐ŸŽฎ About The Game

Square is an arcade-style survival game where you control a customizable square character avoiding endless waves of falling enemies. The longer you survive, the harder it gets! Collect coins to unlock new skins, grab power-ups for temporary advantages, and climb the leaderboards.

โœจ Key Features

  • ๐ŸŽฏ Intense Gameplay - Fast-paced dodging action with increasing difficulty
  • ๐Ÿ‘ค Account System - Create accounts to save progress and track high scores
  • ๐ŸŽจ 30+ Unique Skins - Unlock characters ranging from superheroes to Minecraft creepers
  • ๐Ÿ’ฐ In-Game Economy - Earn coins by surviving and spend them in the shop
  • โšก Power-Ups
    • Boost - Blast through enemies while the screen goes psychedelic
    • Invisibility - Phase through enemies temporarily
    • Auto Gun - Fire bullets automatically to clear your path
  • ๐ŸŽต Dynamic Soundtrack - Multiple music tracks that change each game
  • ๐ŸŽฎ Dual Control Schemes - Play with keyboard (WASD/Arrows) or mouse
  • ๐Ÿ’พ Persistent Saves - Your progress, coins, and unlocks are saved locally

๐Ÿ“ธ Screenshots

Main Menu Main_menu

Gameplay Gameplay

Customization Customization

Invisibility Powerup Invisibility_powerup

Machinegunner Powerup Machinegunner_powerup

Boost Powerup Boost_powerup


๐Ÿš€ Getting Started

Prerequisites

  • Java Runtime Environment (JRE) 8 or higher
  • Windows, macOS, or Linux

Installation

  1. Clone the repository

    git clone https://github.com/TaherJoudeh/Square.git
    cd Square
  2. Compile the game

    javac -d bin src/game/*.java src/gameInputs/*.java
  3. Run the game

    java -cp bin game.Gameplay

Quick Start (Pre-compiled)

  1. Download Square.jar from Releases
  2. Double-click the JAR file or run:
    java -jar Square.jar

๐ŸŽฏ How To Play

Controls

Keyboard Mode:

  • W/โ†‘ - Move Up
  • A/โ† - Move Left
  • S/โ†“ - Move Down
  • D/โ†’ - Move Right
  • P - Pause
  • C - Show coins (during game)
  • ESC - Exit

Mouse Mode:

  • Move your mouse to control your character
  • ESC - Exit

Gameplay Tips

  1. Start Small - Focus on dodging rather than collecting coins at first
  2. Use Power-Ups Wisely - They spawn randomly, so grab them when safe
  3. Watch the Patterns - Some enemies move horizontally, others fall straight down
  4. Earn Coins - You get coins based on your survival time
  5. Unlock Skins - Save up for rare skins that cost more!

๐Ÿ› ๏ธ Technical Details

Built With

  • Language: Java
  • GUI Framework: Swing
  • Audio: Java Sound API
  • Graphics: Java 2D Graphics

Project Structure

Square/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ game/
โ”‚   โ”‚   โ”œโ”€โ”€ Gameplay.java      # Main game loop and rendering
โ”‚   โ”‚   โ”œโ”€โ”€ Accounts.java      # User account management
โ”‚   โ”‚   โ”œโ”€โ”€ GameObject.java    # Base class for game entities
โ”‚   โ”‚   โ”œโ”€โ”€ Handler.java       # Entity manager
โ”‚   โ”‚   โ”œโ”€โ”€ Power.java         # Power-up system
โ”‚   โ”‚   โ”œโ”€โ”€ AudioPlayer.java   # Sound management
โ”‚   โ”‚   โ”œโ”€โ”€ Customize.java     # Skin system
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ gameInputs/
โ”‚       โ”œโ”€โ”€ KeyInput.java      # Keyboard controls
โ”‚       โ”œโ”€โ”€ MouseInput.java    # Mouse controls
โ”‚       โ””โ”€โ”€ Buttons.java       # UI button system
โ”œโ”€โ”€ Data/
โ”‚   โ”œโ”€โ”€ Accounts/              # Saved user accounts
โ”‚   โ”œโ”€โ”€ Audio/                 # Sound effects & music
โ”‚   โ”œโ”€โ”€ Customize/             # Character skins
โ”‚   โ””โ”€โ”€ Powers/                # Power-up graphics
โ””โ”€โ”€ README.md

Architecture Highlights

  • Game Loop: Custom tick-render cycle running at 60 FPS
  • Collision Detection: Rectangle-based bounding box system
  • State Machine: Multiple game states (Menu, Game, Customize, etc.)
  • Persistence: Text-based file storage for accounts and progress

๐ŸŽจ Customization

The game includes 30 unique skins with varying prices:

Price Examples
Free Blue Square, Red Square
300-500 Camo, Rainbow, Happy Blue
1000-2000 Microsoft, Ninja, Thief Mask
2500-4000 Emo Boy, Mustache, Diamond
5000-6000 Batman, Creeper, Dark
7000+ Developer (Premium), ASQ (Ultimate)

๐Ÿ› Known Issues

  • File paths use Windows-style backslashes (affects macOS/Linux compatibility)
  • No multiplayer functionality
  • Screen resolution fixed at 1366x770

๐Ÿ“ Development Journey

This game was created during my 11th grade year as a way to learn:

  • Object-oriented programming in Java
  • Game development fundamentals
  • File I/O and data persistence
  • Audio and graphics programming
  • State management and game loops
  • The skins/cosmetics for the player are made by me and my classmates

It represents countless hours of learning, debugging, and iteration. While the code may not be perfect, I'm proud of what I built and what I learned in the process!


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Taher Joudeh


โญ Support

If you enjoyed this game or found the code helpful for learning, please consider giving it a star! It means a lot for a high school project.

Found a bug? Open an issue!
Want to contribute? Pull requests are welcome!


Made in 11th Grade | 2019

About

Fast-paced arcade dodge game built in Java | Survive, collect power-ups, and unlock 30+ skins | Made in 11th grade

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages