DEV Community

Control a Farming Drone with C++ — Play It in Your Browser (Cropbot)

The text describes a unique browser-based farming game called Cropbot where players control a drone using C++ code. The game challenges players to write C++ to manage a drone that tills, plants, waters, and harvests crops on a grid. Unlike typical farming games, there are no clicks; everything is automated by the code. The player must optimize their code to handle resource constraints like water, energy, and gold, while maximizing score through efficient farming strategies. The core gameplay revolves around designing algorithms and system behavior rather than reacting to events. C++ was chosen for its strong typing and control flow, creating a feeling of engineering a machine rather than scripting a game. The player's code is compiled to WebAssembly and runs in a sandbox, interacting with a restricted drone API. The game offers potential expansions like competitive leaderboards and AI tournaments. Cropbot aims to appeal to players who enjoy automation, systems thinking, and programming-driven gameplay. The author considers this more than just a game and sees potential for a full automation strategy one. The game's URL and repository are provided for access and reference.
favicon
dev.to
dev.to
Image for the article: Control a Farming Drone with C++ — Play It in Your Browser (Cropbot)
Create attached notes ...