- Toolchain error/question (help)
- 19 May 2019 11:17:27 pm
- Last edited by dunlavdy on 19 May 2019 11:22:35 pm; edited 1 time in total
I am programming a game, and there is a syntax error, but I know for a fact that the syntax is correct.
These are the errors:
ERROR (100) Syntax error
WARNING (222) Statement has no effect
ERROR (128) Identifier "gmode" not defined within current scope
I will put in comments, in the code, on the line it says syntax error for.
Thanks if you know what is going on.
Here is the code:
Code:
These are the errors:
ERROR (100) Syntax error
WARNING (222) Statement has no effect
ERROR (128) Identifier "gmode" not defined within current scope
I will put in comments, in the code, on the line it says syntax error for.
Thanks if you know what is going on.
Here is the code:
Code:
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <keypadc.h>
#include <graphx.h>
#include "gfx/logo_gfx.h"
void play();
void gameMode();
void main(void) {
uint8_t leave = 0;
uint8_t pick = 0;
gfx_Begin();
gfx_SetPalette(logo_gfx_pal, sizeof_logo_gfx_pal, 0);
gfx_FillScreen(7);
gfx_PrintStringXY("PONG",135,100);
gfx_PrintStringXY("--------------",100,110);
gfx_PrintStringXY("Press [CLEAR] to Exit",80,130);
gfx_PrintStringXY("Press [ENTER] to Play",80,120);
gfx_PrintStringXY("Press [MODE] to Change Game Mode",45,140);
while(leave==0){
kb_Scan();
if (kb_Data[6] == kb_Clear)
leave=1;
if (kb_Data[6] == kb_Enter){
gfx_FillScreen(7);
play();
}
if (kb_Data[6] == kb_Mode)
gameMode();
}
gfx_End();
os_ClrHome();
}
void gameMode(){
gfx_FillScreen(7);
gfx_PrintStringXY("Choose Game Mode:",50,50);
gfx_PrintStringXY("1: Normal",50,60);
gfx_PrintStringXY("2: Acceleration",50,70);
int8_t gmode = 0; //line with syntax error
while (gmode == 0){
kb_Scan();
if (kb_Data[3] == kb_1)
gmode = 1;
if (kb_Data[4] == kb_2)
gmode = 2;
}
}