git repos / blockattack-game

commit e8d66c68

sago007 · 2016-07-12 17:32
e8d66c686a514f5e364d57bb2e0040b3643dfedc patch · browse files
parent ac976896326fd1b4db3ee8fe4db304054c669e00

Now prints the time that the game is frozen. I might add a cealing to this number based on level at some point

Changed files

M source/code/BlockGameSdl.inc before
diff --git a/source/code/BlockGameSdl.inc b/source/code/BlockGameSdl.inc index 7592e98..be07f29 100644 --- a/source/code/BlockGameSdl.inc +++ b/source/code/BlockGameSdl.inc
@@ -21,6 +21,9 @@ http://www.blockattack.net
===========================================================================
*/
+#include "BlockGame.hpp"
+
+
class BlockGameSdl : public BlockGame {
public:
BlockGameSdl(int tx, int ty) {
@@ -39,6 +42,10 @@ public:
void PrintTextCenteredBoard(int x, int y, const char* text) {
nf_button_font.draw(screen, x+topx+60, y+topy+10, NFont::CENTER, "%s", text);
}
+
+ void PrintIntRightAlignedBoard(int x, int y, int number) {
+ nf_button_font.draw(screen, x+topx+60, y+topy+10, NFont::RIGHT, "%d", number);
+ }
int GetTopX() const {
return topx;
@@ -328,6 +335,9 @@ public:
nf_standard_blue_font.draw(screen, topx+5, topy+5, "%s",strHolder.c_str());
}
}
+ if (!bGameOver && stop > 20) {
+ PrintIntRightAlignedBoard(240, -40, stop/10);
+ }
#if DEBUG
if (AI_Enabled&&(!bGameOver)) {