made defines, instead of hard coded values
and made a max velocity.
SVN-Revision: 204
return(quit);
}
+#define MAX_VEL 10
+#define SPEED 1
+#define SCROLL 60
+
void display_credits()
{
int done;
timer_start(&timer, 50);
scroll = 0;
- speed = 1;
+ speed = 2;
done = 0;
n = d = 0;
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{
- case SDLK_DOWN:
- speed -= 1;
- break;
case SDLK_UP:
- speed += 1;
+ speed -= SPEED;
+ break;
+ case SDLK_DOWN:
+ speed += SPEED;
break;
case SDLK_SPACE:
case SDLK_RETURN:
if(speed >= 0)
- scroll += 60;
+ scroll += SCROLL;
break;
case SDLK_ESCAPE:
done = 1;
break;
}
+ if(speed > MAX_VEL)
+ speed = MAX_VEL;
+ else if(speed < -MAX_VEL)
+ speed = -MAX_VEL;
+
/* draw the credits */
draw_background();