How to set a highscore

Hi, i made a game, but i dont know how to save the highscore?
It doesn’t work with g_highScore.checkHighScore(hscore).
thanks

@sand,
Can you please give us an example of the code that you’re using?

Thanks

this is the code:
i was unable to put in the code tag sorry.

//84Ă—48 screen
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
boolean playing = true;
boolean pause = false;
int hscore;
float score = 0;
const byte lama[] PROGMEM = {16,13,B00001000,B00000000,B00001111,B10000000,B00001011,B10000000,B00001111,B10000000,B00001111,B10000000,B00001110,B00000000,B00001100,B00000000,B11111100,B00000000,B01111100,B00000000,B01111100,B00000000,B01000100,B00000000,B01000100,B00000000,B01100110,B00000000,};
const byte lama_L[] PROGMEM = {16,13,B00001000,B00000000,B00001111,B10000000,B00001011,B10000000,B00001111,B10000000,B00001111,B10000000,B00001110,B00000000,B00001100,B00000000,B11111100,B00000000,B01111100,B00000000,B01111100,B00000000,B01000100,B00000000,B01100100,B00000000,B00000110,B00000000,};
const byte lama_R[] PROGMEM = {16,13,B00001000,B00000000,B00001111,B10000000,B00001011,B10000000,B00001111,B10000000,B00001111,B10000000,B00001110,B00000000,B00001100,B00000000,B11111100,B00000000,B01111100,B00000000,B01111100,B00000000,B01000100,B00000000,B01000110,B00000000,B01100000,B00000000,};
const byte cactus[] PROGMEM = {8,8,B00110000,B00110000,B10110100,B10110100,B11111100,B00110000,B00110000,B00110000,};
const byte cloud[] PROGMEM = {16,4,B00000110,B00000000,B00011111,B00000000,B01111111,B10000000,B11111111,B11000000,};
int xp = 5,yp = 31; //x&y player
int lrf = 0; //lama right foot on bottom
boolean lrfh = true; //lama right foot high
int dyp = 31; //default y player (bottom)
boolean jumping = false;
boolean up = true;
int jh = 10; //jump height
float ss = 1; //speed
int buh = 0; //slowing down when jumping down
int ycactus = 36;
float xcactus[3] = {90, 120, 150};
float dxcactus[3]; //default xcactus
float xblines[4] = {20,40,60,80}; //x bottom lines
float yblines = 46; //y bottom lines
float xclouds[2] = {20,60}; //x bottom lines
float yclouds = 5; //y bottom lines

void setup() {
for(int i=0; i<3; i++){
dxcactus[i] = xcactus[i];
}
gb.begin();
gb.titleScreen(F(“Lama Run”));
}

void loop() {
if(gb.update()){
//exit buttons
if(gb.buttons.pressed(BTN_B)){
gb.titleScreen(F(“Lama Run”));
}
if(gb.buttons.pressed(BTN_C)){
gb.titleScreen(F(“Lama Run”));
}

//draw score counter
if(pause){
gb.display.clear();
gb.display.cursorX = 12;
gb.display.cursorY = 14;
gb.display.fontSize = 2;
gb.display.println(“PAUSE”);
gb.display.fontSize = 1;
gb.display.cursorY = 0;
if(score<10){gb.display.cursorX = 81;}
if(score<100 && score > 9){gb.display.cursorX = 77;}
if(score<1000 && score > 99){gb.display.cursorX = 73;}
if(score<10000 && score > 999){gb.display.cursorX = 69;}
if(score<100000 && score > 9999){gb.display.cursorX = 66;}
gb.display.println(score);
if(gb.buttons.pressed(BTN_A)){pause = false;}
}
else{
if(score<10){gb.display.cursorX = 81;}
if(score<100 && score > 9){gb.display.cursorX = 77;}
if(score<1000 && score > 99){gb.display.cursorX = 73;}
if(score<10000 && score > 999){gb.display.cursorX = 69;}
if(score<100000 && score > 9999){gb.display.cursorX = 66;}
gb.display.println(score);
if(playing)
score += ss;
if(score > 1950 && score < 2000)
gb.display.println(“speed up”);
if(score > 2000)
ss = 2;
if(score > 4950 && score < 5000)
gb.display.println(“speed up”);
if(score > 5000)
ss = 3;

if(playing){
//draw lama foot steps
if(jumping){
gb.display.drawBitmap(xp,yp,lama,NOROT,NOFLIP);
}
if(!jumping){
if(lrfh){
gb.display.drawBitmap(xp,yp,lama_R,NOROT,NOFLIP);
lrf += 1;
}
else{
gb.display.drawBitmap(xp,yp,lama_L,NOROT,NOFLIP);
lrf -= 1;
}
if(lrf == 5){
lrfh = false;
}
if(lrf == 0){
lrfh = true;
}
}

//draw ground line
gb.display.drawFastHLine(0,44,84);

//jump
if(yp != dyp){
jumping = true;
}
if(jumping){
if(up){
if(gb.buttons.timeHeld(BTN_UP)){buh = 1;}
else{buh = 0;}
yp -= 1 +ss - (buh/2);
}
if(yp <= jh){
up = false;
}
if(!up){
if(gb.buttons.timeHeld(BTN_UP)){buh = 1;}
else{buh = 0;}
yp += 1 +ss - buh;
}
if(yp >= dyp){
yp = dyp;
jumping = false;
up = true;
}
}

//buttons
if(gb.buttons.pressed(BTN_UP)){
gb.sound.playNote(460,1,0);
jumping = true;
}
if(gb.buttons.pressed(BTN_A)){
pause = true;
}

//draw cactuses
for(int i=0;i<3;i++){
gb.display.drawBitmap(xcactus[i],ycactus,cactus,NOROT,NOFLIP);
xcactus[i] -= ss;
if(gb.collideBitmapBitmap(xcactus[i],ycactus,cactus,xp,yp,lama)){
gb.sound.playNote(400,10,0);
playing = false;
}
if(xcactus[i]<= -5){
xcactus[i] = random(3,6)*30;
}
}

//draw bottom lines
for(int i=0;i<3;i++){
gb.display.setColor(GRAY);
gb.display.drawRect(xblines[i],yblines,3,1);
gb.display.setColor(BLACK);
xblines[i] -= ss;
if(xblines[i]<= -5){
xblines[i] = random(84,110);
}
}

//draw clouds
for(int i=0;i<2;i++){
gb.display.setColor(GRAY);
gb.display.drawBitmap(xclouds[i],yclouds,cloud,NOROT,NOFLIP);
gb.display.setColor(BLACK);
xclouds[i] -= ss;
if(xclouds[i]<= -10){
xclouds[i] = random(84,100);
}
}
}

//game over screen
if(!playing){
if(score > hscore)
hscore = round(score);
gb.display.clear();
gb.display.cursorX = 8;
gb.display.cursorY = 14;
gb.display.fontSize = 2;
gb.display.println(“GAME OVER”);
gb.display.fontSize = 1;
gb.display.cursorX = 20;
gb.display.cursorY = 28;
gb.display.print("score: ");
gb.display.cursorX = 46;
gb.display.println(round(score));
gb.display.cursorX = 16;
gb.display.cursorY = 40;
gb.display.print("highscore: ");
gb.display.cursorX = 64;
gb.display.println(hscore);
if(gb.buttons.pressed(BTN_A)){
playing = true;
score = 0;
ss = 1;
yp = 31;
for(int i=0;i<4;i++){
xcactus[i] = dxcactus[i];
}
}
}
}
}
}