Game loop diagram (from the French report): drone phase, grid update, storm phase, and collision handling

Programming · 3/12

Drone rescue game

With my partner Ilyane Haida, I programmed a rescue game on a 12x12 grid. Drones have to locate survivors and bring them to a hospital while avoiding storms and buildings, on a battery that keeps draining.

You can play right in your browser. This widget actually runs the Python script below (unmodified, fetched live) using Pyodide (CPython compiled to WebAssembly), with nothing to install. Moves are entered in the field that appears below the grid, and it stays visible the whole time you're answering.

The rules in short.

  • The grid is 12×12, with columns A to L and rows 0 to 11.
  • On the grid, B is a building, H the hospital, S a survivor, T a storm and D a drone.
  • Each turn, move up to 3 drones by one square (diagonals included) to pick up survivors and bring them to the hospital.
  • Each move costs 1 battery point (+2 to pick up a survivor); battery recharges at the hospital.
  • A storm disables any active drone it touches while moving, for 2 turns.
  • Each survivor delivered to the hospital earns 1 point. The game ends when all survivors are saved, when all drones are down, or after 40 turns.
  • To play, enter the number of the drone to move, without the D (1 for D1, or f to end the turn), then its destination as column row, for example C 5.

Architecture

The program comes in five parts, configuration loading (JSON), random entity placement, display functions, the movement and rules engine, and scoring. The project report documents each of them in detail.

Documents

See all projects