java-game is a simple 2D spaceship game built using core Java. It features a spaceship navigating through obstacles, demonstrating basic Java game development using JFrame, KeyListener, and sprite rendering.
- 🛸 Control a spaceship using keyboard arrows
- 🧱 Avoid obstacles (with simple collision logic)
- 🎨 Renders graphics using Java AWT/Swing
- 📦 Lightweight and beginner-friendly Java game
java-game/
│
├── Game.java # Main game logic and rendering
├── Game.class # Compiled class file
├── Game$1.class # Inner class for event handling
├── spaceship.png # Spaceship sprite
├── obs.png # Obstacle image
└── README.md # Project documentation
- Clone or download the repository:
git clone https://github.com/vishalvnair124/java-game.git- Compile and run the game using terminal:
cd java-game
javac Game.java
java GameMake sure spaceship.png and obs.png are in the same folder as Game.java.
- Java JDK (8 or higher)
- Any text editor or IDE (e.g., VS Code, IntelliJ, NetBeans)
- OS: Windows/Linux/macOS
Vishal V Nair
Java Enthusiast
📫 GitHub: @vishalvnair124