The Code In question:
Code:
it seems like the high score is either not reading or not writing corrfectly as the value does not seem to display correctly ie: it shows your current score instead of your high score
Code:
void gameOver()
{
while(kb_Data[1] & kb_2nd)
kb_Scan();
uint8_t temp = 0;
uint8_t* High = &temp;
ti_var_t hs = ti_Open("XW3HS","r");
ti_Read(High,4,1,hs);
ti_Close(hs);
if(*High < score)
{
hs = ti_Open("XW3HS","w");
ti_Write((char)score,, sizeof(uint8_t),hs);
ti_Close(hs);
pgrm_CleanUp();
} else
{
ti_Close(hs);
pgrm_CleanUp();
}
char* appendValue1 = float2str(*High);
char* appendValue2 = float2str(score);
gfx_ScaledSprite_NoClip(background, 0, 0, 10, 10);
gfx_PrintStringXY("YOUR SCORE:",(24+(16*11)),100);
gfx_PrintStringXY(appendValue2,(24+(16*11)),110);
gfx_PrintStringXY("PREV BEST:" ,24,100);
gfx_PrintStringXY(appendValue1,24,110);
gfx_PrintStringXY("PRESS 2ND TO CONTINUE",24,160);
gfx_BlitBuffer();
while(!(kb_Data[1] & kb_2nd))
kb_Scan();
while(kb_Data[1] & kb_2nd)
kb_Scan();
}
it seems like the high score is either not reading or not writing corrfectly as the value does not seem to display correctly ie: it shows your current score instead of your high score