Testing, Testing, 1, 2, 3....
So the parser is written. The Game logic is done. We're storing the game state "in memory" and dumping it every 5 minutes as a JSON file (on restart, if such a dump exits, it's automatically loaded). Given more time I'd remove all my shonky data related code and just use REDIS.
Unlike previous PyWeeks I've been WRITING TESTS... my god this has been both a positive and negative.
Midweek, I was almost ready to press the "sod it" button, just hack code and forget about tests. It felt I was writing three times as much code as was needed and I wasn't sure anything would be finished in time.
However, I persisted with the tests and I'm so pleased for it. I *know* my parser works because the tests demonstrate it. It feels good to refactor the code as I realise things need to change because the tests feel like a safety net to give me confidence I've not broken anything else.
What's left to do? Connect the websocket code to the actual game, finish the simple JS client and (hopefully) add some simple notion of scripting to the game.
In any case, I've **loved** working on this game, and the team chats with team-mate Andrew have been a huge amount of fun. No matter what, I think I'll still keep refining this game once PyWeek is over (e.g. Redis and a bunch of refactoring I don't have time to do now).
No matter the result, this PyWeek has been the best so far. Thanks Dan for organising it!
(log in to comment)