Friday, December 27, 2013

Combat Log


Hey, remember when I used to be updating this?

I'm winding down the One Game A Month challenge for 2013, and I think I'm going to make my December game a set of small feature improvements on the November game, in part to justify the relaxing and time spent with friends and family I've already done, and am planning on for the remainder of the year.

The feature I want to brag about here is the combat log you see on the right hand side of the screenshot above. Nothing super technically interesting; just a singleton object that collects strings into an array, which anybody can log messages into. Then, in the display loop, I pull out the last several lines, measure their height, and draw them such that the bottom of the log doesn't scroll off the bottom of the screen. Most of the time, that means that I scroll off the top of the window, which is good, but at the beginning, the text starts at the top of the log, and gets added to, until such time as I need to scroll. Maybe that's the right thing, I don't think players will have a strong opinion in any case.

Shout out to cgtextures.com for the paper texture for the background of the log. It looks sort of uniformly beige if you're not looking carefully, but there's some sort of darker smudge at the bottom, and a few speckles here and there, which you get from photographic real paper imagery.


No comments:

Post a Comment