Five lanes of traffic, five lanes of river, five lily pads to fill. A Java Swing Frogger clone that speeds up every round.
- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Replace deprecated java.applet.Applet with Swing (JFrame + JPanel) - Replace pre-JDK1.1 java.awt.Event input with KeyListener / KeyEvent - Migrate to Maven standard layout (src/main/java, src/main/resources) - Add pom.xml with exec-maven-plugin; targets Java 17 - Rewrite all game logic from FroggerJack prototype into clean class hierarchy: Entity → MovingEntity → Car / Log / Turtle; Frog extends Entity - Fix Speed.gen() argument inversion (infinite loop bug) - Remove double-initialisation of cars in old init() - Fix entites/ typo → entities/ - Add image caching; load via getResourceAsStream (no Applet codebase) - Use CopyOnWriteArrayList for thread-safe entity lists - Port river drift, car collision, goal detection, and round advance logic - Delete IDE boilerplate (.classpath, .project), unused ThreadSleeper, ExLog - Move assets to src/main/resources/images/; drop frogboard.jpg and .psd - Replace MIT LICENSE with CC BY-NC-SA 3.0 - Rewrite README with build instructions and project layout - Expand .gitignore to cover IDE folders, OS files, and .claude/ |
||
| src/main | ||
| .gitignore | ||
| LICENSE | ||
| pom.xml | ||
| README.md | ||
Frogger
A Frogger clone written in Java using Swing.
Description
Guide the frog safely across five lanes of traffic and five lanes of river hazards to reach one of five lily pads at the top. Fill all five lily pads to advance to the next round. Each round increases the speed of all obstacles.
Controls
| Key | Action |
|---|---|
| ↑ | Move up |
| ↓ | Move down |
| ← | Move left |
| → | Move right |
Rules
- Roads (bottom half): Avoid all cars — any contact is fatal.
- River (top half): Stand on a log or turtle to cross — falling in the water is fatal. If a log or turtle carries the frog off the edge of the screen, the frog drowns.
- Goals: Land on one of the five lily pads at the top to score. Reaching the top row outside a valid pad is also fatal.
- Lives: You start with 3 lives. The game ends when all are lost.
- Scoring: 100 points per lily pad claimed, 200 bonus for completing a round.
Requirements
- Java 17 or later
- Apache Maven 3.8+
Build & Run
# Run directly with Maven
mvn exec:java
# Or build a fat JAR then run it
mvn package
java -jar target/frogger.jar
Project Structure
src/main/
├── java/com/exikle/frogger/
│ ├── FroggerMain.java Entry point — creates the JFrame
│ ├── GamePanel.java Game loop, input handling, rendering, collision
│ ├── Board.java Game state (round, lives, score, goals)
│ ├── Speed.java Random non-zero speed utility
│ ├── entities/
│ │ ├── Entity.java Abstract base: position, image, draw()
│ │ ├── MovingEntity.java Adds speed, per-frame update(), screen wrapping
│ │ ├── Car.java Road obstacle
│ │ ├── Log.java River platform
│ │ ├── Turtle.java River platform
│ │ ├── Frog.java Player character with directional sprites
│ │ └── Direction.java UP / DOWN / LEFT / RIGHT enum
│ └── graphics/
│ └── Hud.java HUD overlay (round, lives, score)
└── resources/images/
└── *.png All game sprites
License
CC BY-NC-SA 3.0 © 2014 Dixon D'Cunha