
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
AtoLand rows0to11. - On the grid,
Bis a building,Hthe hospital,Sa survivor,Ta storm andDa 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 (
1forD1, orfto end the turn), then its destination ascolumn row, for exampleC 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
-
Project report (PDF)
-
Source code (Python)
