Monday, August 17, 2015

Setting a Timer for Incentive

Once the maze has been setup as a challenge, why go through it? A quick solution is to create a timer. By setting an AHUD class called AMazeHUD, I can draw a quick rectangle, font title, and time to the screen. The answer is anything but simple, however. Unfortunately, due to the heinously slow nature of C++ compilation and the C++ only interaction of the GameMode, I can set the HUD to the GameMode via code, but can only change HUD values in code. Need to move the rectangle by a small offset? That'll take 2-3 minutes at the least.

FText::AsNumber also is a strangely more complex method than the %.2f format that a lot of people are familiar with in printf; the precision and other details is set in a numerical format structure used to to create an actual string with the proper (2 decimal points) precision I am looking for. That said, a simple timer is now set for the ball, which listens to the pawn's death boolean to know when to reset. Apart from spending an hour to properly set the rectangle, I may also interpolate the color to red in the few seconds upon player death for a more interesting effect.


No comments:

Post a Comment