added randomInit and increased speed

This commit is contained in:
ranzwertig 2011-08-12 18:15:29 +02:00 committed by Stefan `Sec` Zehl
parent 36f8eb4292
commit 8f4d81f8f4
2 changed files with 11 additions and 8 deletions

View File

@ -91,6 +91,7 @@ GetVoltage
isNight isNight
_timectr _timectr
crc16 crc16
randomInit
getRandom getRandom
getSeconds getSeconds
iapReadSerialNumber iapReadSerialNumber

View File

@ -42,8 +42,8 @@
#define SHOT_DELAY 12 #define SHOT_DELAY 12
#define ASTEROID_FREQ 25 #define ASTEROID_FREQ 25
#define SCROLL_SPEED 20 #define SCROLL_SPEED 20
#define ASTEROID_MIN_SPEED 6 #define ASTEROID_MIN_SPEED 5
#define ASTEROID_MAX_SPEED 5 #define ASTEROID_MAX_SPEED 4
#define SHIP_SAVE_TICKS 240 #define SHIP_SAVE_TICKS 240
#define INCREASE_GAME_SPEED 50 #define INCREASE_GAME_SPEED 50
@ -180,9 +180,11 @@ static void draw_splash(void){
bool step = false; bool step = false;
while(key==0) { while(key==0) {
lcdFill(0); lcdFill(0);
if (highscore_set(game.score, GLOBAL(nickname))){
DoString (16,15,"HIGHSCORE!");
} else {
DoString (16,15, "GAME OVER"); DoString (16,15, "GAME OVER");
if (highscore_set(game.score, GLOBAL(nickname))) }
DoString (16,25,"HIGHSCORE!");
DoString (24,40, "GAME BY"); DoString (24,40, "GAME BY");
DoString (10,50, "@RANZWERTIG"); DoString (10,50, "@RANZWERTIG");
lcdDisplay(); lcdDisplay();
@ -215,6 +217,8 @@ static uint32_t highscore_get(char nick[]){
static void init_game(void) { static void init_game(void) {
randomInit();
game.ticks = 0; game.ticks = 0;
game.ships = 3; game.ships = 3;
game.score = 0; game.score = 0;
@ -485,5 +489,3 @@ static void conrtols(void){
shoot(); shoot();
} }
} }