Syntensity, however, is focused on games (at least for the near future), and it will launch with insta ctf as its main gameplay mode. So, over the last 4 days I wrote an insta ctf 'activity' for the Intensity Engine entirely from scratch. This ended up taking about 650 lines of code, split up into several components:
- GameManager: Keeps score, assigns players to teams, and in general manages the game. Plugins for the GameManager let you control things like what determines when the game is over (a high enough score, for example).
- Health: A plugin for the player class that adds a 'health' attribute ('state variable' in Intensity Engine terminology) to players, and manages player death and respawning.
- Firing: Handles guns and their behavior (including delays after firing, etc.). A SniperRifle example gun gives the 'insta' gameplay element - one shot and you're dead.
- CTF: A plugin for the GameManager that handles the flags and their behavior.
(All the code is already in the repo, if anyone wants to take a look.)