#include "BluePaddle.h"
#include "SDL.h"
BluePaddle::BluePaddle ( void )
{
bluePaddle = SDL_LoadBMP ( "BluePaddle.bmp" );
dst.x = 20;
dst.y = 200;
}
BluePaddle::~BluePaddle ( void )
{
SDL_FreeSurface ( bluePaddle );
}
void BluePaddle::makeBluePaddle ( SDL_Surface *screen )
{
SDL_BlitSurface ( bluePaddle, NULL, screen, &dst );
}
void BluePaddle::moveBluePaddle ( Uint8 *keys )
{
if ( ( keys[SDLK_UP] == SDL_PRESSED ) && ( dst.y > 55 ) )
dst.y -= 4;
if ( ( keys[SDLK_DOWN] == SDL_PRESSED ) && ( dst.y < 333 ) )
dst.y += 4;
}
int BluePaddle::giveYBluePaddle ( void )
{
return dst.y;
}