reaction game

Home Read the Story Download Credits

Christmas levels

25 December 2019

photo

(christmas tree, source: clipartpal)

It’s Christmas time again, Merry Christmas if you’re reading this on the 25th.

Today I’m building a new deployment with three whole levels in it, each with increasing difficulty. Still only takes a minute to play through, but proves the framework is working :)

Along the way, I realised I was abusing the Wpf DrawingVisual architecture by recreating all the Visuals every cycle. Turns out this is totally not needed, so I refactored to only update the properties that change. I’m still recreating the Visuals on a few key events to make everything easier to manage (e.g. window resize, new levels) but much less than before. Doing this refactoring also helped clarify the game logic a lot.

After getting the second level working, I realised that the transition from one level to the next was way too harsh. Consequently, I added a transition animation (the first animation!) and that forced even more code tidying. Things are beginning to feel much more logical now. I’m a great believer in refactoring when things start to feel awkward, it almost always helps down the line.

I also played about a bit with larger levels and found myself always getting disorientated. In theory that could be part of the challenge, but I just found it frustrating. So I added a sort of heads-up-display indicator that shows the direction of the centre of the world. This takes the form of a small orange bar around the edge of the screen that points the direction.

photo

(the hud direction indicator)

Overall, this is a pretty exciting release, it’s finally beginning to feel like a game :) Well-timed for Christmas day.

Up next

Next up, I plan to look at adding a Scoreboard and High Scores to the game. There will be points available for collecting plasma and finishing levels. Points will be linked to time, so the longer you take, the less you get. That should help add an element of challenge.