Im using the HW accelerated SDL, and whenever I press teh A button, the game quits, and if I include
CODE
case SDL_QUIT:
quit=true;
break;
It says 12 was used twice in the switch statement. I dont want to stop using HW Accelerated SDL, as it gives me a peedboost. Also, L and R are swapped.
Also: In my volume control, when the user presses volume up, I set a variable, volc to 1, and if they press volume down, i set it to -1, when thy release either, i set it to zero, then, after the input code, I have
CODE
if(volume<=150 && volume >=-1 && volc !=0)
{ volume+=volc;
Mix_VolumeMusic(volume);
Mix_Volume(-1,volume);}
When I hold vomule down, the music gets quieter, when I hold volume up, it gets louder, but if i put the volume down to zero, and hold volume up, the volume doesnt go back up. Im sure this is some simple programming error, but I cant find it.
To find the FPS, I have a variable, frame I increment every frame, and I call
CODE
drawTextInt (screen,frame/(tv.tv_sec-start_fps+1),0,0,255,255,255);
every frame.
1. Is this the right way to find FPS?
2. It starts by moving up and down 10, then goes up to moving around 11, then 12, etc every few seconds, until it stops at 27. Is this normal?
CODE
case SDL_QUIT:
quit=true;
break;
It says 12 was used twice in the switch statement. I dont want to stop using HW Accelerated SDL, as it gives me a peedboost. Also, L and R are swapped.
Also: In my volume control, when the user presses volume up, I set a variable, volc to 1, and if they press volume down, i set it to -1, when thy release either, i set it to zero, then, after the input code, I have
CODE
if(volume<=150 && volume >=-1 && volc !=0)
{ volume+=volc;
Mix_VolumeMusic(volume);
Mix_Volume(-1,volume);}
When I hold vomule down, the music gets quieter, when I hold volume up, it gets louder, but if i put the volume down to zero, and hold volume up, the volume doesnt go back up. Im sure this is some simple programming error, but I cant find it.
To find the FPS, I have a variable, frame I increment every frame, and I call
CODE
drawTextInt (screen,frame/(tv.tv_sec-start_fps+1),0,0,255,255,255);
every frame.
1. Is this the right way to find FPS?
2. It starts by moving up and down 10, then goes up to moving around 11, then 12, etc every few seconds, until it stops at 27. Is this normal?