paulagrata.com View on GitHub

04 / Games

Poodle

A little farming RPG built around a familiar daily rhythm and a world worth wandering through.

  • Python
  • Pygame
  • Tiled
  • PyTMX

01 / The idea

Give a cozy routine room for mystery.

Poodle is a 2D farming RPG I built in Python with Pygame, inspired by Stardew Valley. Farming, foraging, and trading share an in-game clock, so a trip to the merchant takes time out of the same day you use to tend your crops or explore. I wanted even a small decision like buying seeds to change how the rest of the day plays out.

02 / The architecture

Let the map define how the world works.

I authored the map in Tiled and used PyTMX to load data/map.tmx into Pygame. The Level class reads named layers such as Collision, Player, and Farmable to define where movement is blocked, where the player spawns, and where crops can grow. My CameraGroup applies a camera offset and sorts sprites by layer and vertical position, so the player can pass in front of or behind scenery as they move.

03 / The details

Make every tool change the right tile.

I calculate the tool’s target from the player’s position and facing direction, so the hoe or watering can acts on the tile in front of the player. SoilLayer tracks whether each tile is farmable, tilled, or watered, and rain can water the soil through the same system. Once a crop becomes harvestable, a collision check collects it into the player’s item inventory.

04 / The build

Code the game loop, movement, and persistence.

I wrote Game.run() to process Pygame events, convert the frame’s elapsed time to seconds, and pass that delta time into Level.run(dt) before updating the display. In Player.move(dt), I normalize the input vector so diagonal movement isn’t faster, then scale movement by delta time and resolve hitbox collisions one axis at a time. I also wrote a reusable Timer class to control when tool actions fire and how quickly players can switch tools. For persistence, I added GameManager routines that serialize the player’s item inventory to JSON and load it back through the pause menu.

Poodle Gameplay