invaders now do meshscore

This commit is contained in:
Stefan `Sec` Zehl 2011-08-03 23:13:44 +02:00
parent 8b93635425
commit fe500650e9
2 changed files with 18 additions and 1 deletions

View File

@ -61,3 +61,7 @@ font
Font_Invaders Font_Invaders
Font_7x8 Font_7x8
lcdBuffer lcdBuffer
meshGetMessage
nickname
uint32touint8p
uint8ptouint32

View File

@ -9,6 +9,8 @@
#include "lcd/display.h" #include "lcd/display.h"
#include "lcd/allfonts.h" #include "lcd/allfonts.h"
#include "funk/mesh.h"
#include "usetable.h" #include "usetable.h"
/**************************************************************************/ /**************************************************************************/
#define POS_PLAYER_Y 60 #define POS_PLAYER_Y 60
@ -155,11 +157,22 @@ void screen_level() {
} }
bool highscore_set(uint32_t score, char nick[]) { bool highscore_set(uint32_t score, char nick[]) {
MPKT * mpkt= meshGetMessage('i');
if(MO_TIME(mpkt->pkt)>score)
return false;
MO_TIME_set(mpkt->pkt,score);
strcpy((char*)MO_BODY(mpkt->pkt),nick);
return true; return true;
} }
uint32_t highscore_get(char nick[]){ uint32_t highscore_get(char nick[]){
return 0; MPKT * mpkt= meshGetMessage('i');
strcpy(nick,(char*)MO_BODY(mpkt->pkt));
return MO_TIME(mpkt->pkt);
} }
void init_game(void) { void init_game(void) {