Question about SDL_Keysym and my program.
I have integrated SDL_Keysym into my text game, but I am having problems and I think I know what it is, just want to know for sure.
If I have this piece of code:
do {
while(SDL_PollEvent(&event)){
switch(event.type){
case SDL_KEYDOWN:
if(event.key.keysym.sym==SDLK_LEFT){
mpa.MoveChar(x, y);
break;}
else if(event.key.keysym.sym==SDLK_RIGHT){
mpa.MoveChar(+x, y);
break;}
else if(event.key.keysym.sym==SDLK_UP){
mpa.MoveChar(x, +y);
break;}
else if(event.key.keysym.sym==SDLK_DOWN){
mpa.MoveChar(x, -y);
break;}
case SDL_KEYUP:
break;}
}
}while(go == 0);
Does c++ understand incremented, decremented variables? Such as -x, or +y?
--EDIT--
It compiles just fine with my make file, so maybe its one of those bugs that aren't seen during compilation?
If want the actual source code, please ask, and I'll send it up to my server and post the address.
|