2024
Mad Tycoon
A park sim I built in Java, from the game loop up.
Mad Tycoon is a 2D park management game from the ELTE IK Software Technology course. Three of us. The brief was a playable tycoon: place rides, keep visitors happy, do not let the park fall apart.
I built the simulation core — the loop, the entity hierarchy, pathfinding for visitors, and the staff/visitor behaviour that makes the park feel alive.
You place attractions, shops, decoration, and paths. Visitors arrive, queue, get hungry, and leave if you ignore them. Staff clean and repair. It is a small economy with a lot of objects moving at once, which is why the loop had to be honest about time.
Java, JDK 8, Apache Ant. In-game objects sit on a hierarchy I designed: GameObject at the base, Entity for anything that moves and decides, then visitors, workers, buildings.
src/hu/elte/madtycoon/objects/
├── buildings/
├── entities/
│ ├── Cleaner.java
│ ├── RepairMan.java
│ └── Visitor.java
├── Building.java
├── Entity.java
├── GameObject.java
└── Worker.java
Each tick calculates delta, steps the world, fills a sprite buffer, then paints. Frame-rate independent, driven by a Swing Timer:
private void loop(ActionEvent event)
{
renderBuffer = new SpriteRenderBuffer(RENDER_BASE_CAPACITY);
float delta = time() * timeScale;
time += delta;
world.update(delta);
world.render(renderBuffer);
hud.updateGUI();
builder.updateGUI();
canvas.repaint();
}
A playable build is on GitHub, release 1.0.0. This is the project that shows I can take a sim from an empty Java repo to something you can watch run.