From: Jason Woofenden Date: Sat, 31 Jan 2009 03:56:39 +0000 (-0500) Subject: made cursor blink when entering a high score X-Git-Tag: 0.5.4~23 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=8c4076c17519e9f5a2bfc45fe1b885d9ce806b54;ds=sidebyside made cursor blink when entering a high score --- diff --git a/config.h b/config.h index 91b8c3b..203c5ca 100644 --- a/config.h +++ b/config.h @@ -57,4 +57,7 @@ #define MAX_PATH_LEN 1024 +// number of milliseconds the blinky cursor stays visible/invisible +#define CURSOR_BLINK_TIME 300 + #endif // VOR_CONFIG_H diff --git a/score.c b/score.c index b9c666e..07c52a5 100644 --- a/score.c +++ b/score.c @@ -161,6 +161,8 @@ display_scores(uint32_t x, uint32_t y) { char t[1024]; int i,h = font_height(); + int display_cursor = (SDL_GetTicks() / CURSOR_BLINK_TIME) % 2; + font_write(x+30, y, "High scores"); y += h; @@ -172,7 +174,7 @@ display_scores(uint32_t x, uint32_t y) font_write(x, y, t); snprintscore(t, 1024, g_scores[g_easy][i].score); font_write(x+50, y, t); - if(i == cur_score) snprintf(t, 1024, "%s_", g_scores[g_easy][i].name); + if(display_cursor && i == cur_score) snprintf(t, 1024, "%s_", g_scores[g_easy][i].name); else snprintf(t, 1024, "%s", g_scores[g_easy][i].name); font_write(x+180, y, t); } diff --git a/todo b/todo index 61fac3b..b43d2cd 100644 --- a/todo +++ b/todo @@ -1,5 +1,3 @@ -**** Finish porting to Windows (should be only file.c and args.c, I think) - *** Move game logic into a script so we can have "variations". * Then an in-game menu to choose which game: Rock Dodger @@ -9,10 +7,10 @@ Tag Deathmatch -** Switch to a scalable font and all ray-traced graphics +** Switch all ray-traced graphics (only big green messages left) * Then we can run at the native screen size -* BUG: Rocks can be created touching, causing a high-velocity bounce. +* fix rock generation code so they are never created overlapping * Deltas on high score display?