Cambiado tamaño de la ventana
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#define WINDOW_CAPTION "demo_pelotas2"
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
#define WINDOW_SIZE 3
|
||||
#define BALL_SIZE 8
|
||||
#define GRAVITY 0.2f
|
||||
#define TEXT_TIME 100
|
||||
|
||||
@@ -100,7 +100,7 @@ bool init()
|
||||
else
|
||||
{
|
||||
// Create window
|
||||
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH * 2, SCREEN_HEIGHT * 2, SDL_WINDOW_SHOWN);
|
||||
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH * WINDOW_SIZE, SCREEN_HEIGHT * WINDOW_SIZE, SDL_WINDOW_SHOWN);
|
||||
if (window == nullptr)
|
||||
{
|
||||
printf("Window could not be created! SDL Error: %s\n", SDL_GetError());
|
||||
@@ -180,81 +180,59 @@ void checkEvents()
|
||||
switch (event->key.keysym.sym)
|
||||
{
|
||||
case SDLK_ESCAPE:
|
||||
{
|
||||
shouldExit = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_SPACE:
|
||||
{
|
||||
pushUpBalls();
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_g:
|
||||
{
|
||||
switchBallsGravity();
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_1:
|
||||
{
|
||||
index = 0;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_2:
|
||||
{
|
||||
index = 1;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_3:
|
||||
{
|
||||
index = 2;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_4:
|
||||
{
|
||||
index = 3;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_5:
|
||||
{
|
||||
index = 4;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_6:
|
||||
{
|
||||
index = 5;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_7:
|
||||
{
|
||||
index = 6;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDLK_8:
|
||||
{
|
||||
index = 7;
|
||||
initBalls(index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void update()
|
||||
|
||||
Reference in New Issue
Block a user