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);
DoString (16,15, "GAME OVER"); if (highscore_set(game.score, GLOBAL(nickname))){
if (highscore_set(game.score, GLOBAL(nickname))) DoString (16,15,"HIGHSCORE!");
DoString (16,25,"HIGHSCORE!"); } else {
DoString (16,15, "GAME OVER");
}
DoString (24,40, "GAME BY"); DoString (24,40, "GAME BY");
DoString (10,50, "@RANZWERTIG"); DoString (10,50, "@RANZWERTIG");
lcdDisplay(); lcdDisplay();
@ -214,6 +216,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;
@ -484,6 +488,4 @@ static void conrtols(void){
} else if (gpioGetValue(RB_BTN4)==0) { } else if (gpioGetValue(RB_BTN4)==0) {
shoot(); shoot();
} }
} }