For some reason Visual C++ keeps saying missing argument list and than points to the red line.Code:#include "SDL.h" #include "SDL_image.h" #include <string> using namespace std; //Event structure SDL_Event event; //Constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; const short SCREEN_BPP = 32; //Surfaces SDL_Surface *screen = NULL; SDL_Surface *paddle = NULL; //Image loading function SDL_Surface *load_image(string filename) { //loaded image will go here SDL_Surface *loadedImage = NULL; //optimized will be contained here SDL_Surface *optimizedImage = NULL; //load starting image loadedImage = IMG_Load(filename.c_str()); //If loading was okay if(loadedImage != NULL) { //Convert optimizedImage = SDL_DisplayFormat( loadedImage ); //Free loaded image SDL_FreeSurface( loadedImage ); } else if( loadedImage == NULL) { return 0; } //return optimized image return optimizedImage; } //Apply image void apply_surface(int x, int y, SDL_Surface *source, SDL_Surface *destination) { //Create temp rect to hold offsets SDL_Rect offset; //Offsets offset.x = x; offset.y = y; //Blit Surface SDL_BlitSurface(source, NULL, destination, &offset); } //Init all subsystems bool Init_All() { //Initalize if(SDL_Init(SDL_INIT_EVERYTHING) == -1) { return false; } //load screen screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE); //check for screen loading errors if(screen == NULL) { //error found return false; } //set caption of window SDL_WM_SetCaption("Pong Game", NULL); //everything loaded fine return true; } //load all pictures bool load_files() { //load paddle paddle = load_image("paddle.png"); if(paddle == NULL) { return false; } //everything loaded okay return true; } void clean_up() { SDL_FreeSurface(paddle); SDL_Quit(); } //constants const int BALL_HEIGHT = 10; const int BALL_WIDTH = 6; class Paddle { private: //offsets of paddle int xCoord, yCoord; //Velocity of paddle int xVel, yVel; public: //Init variables void paddle(); //Deconstructor ~paddle(); //handles keypresses void handle_input(); //moves paddle void move(); //shows paddle on screen void show(); }; void Paddle::paddle() { //Set starting offsets xCoord = 620; yCoord = 240; //set starting velocity xVel = 0; yVel = 0; } ~Paddle::paddle() { } void Paddle::handle_input() { //if key is pressed if(event.type == SDL_KEYDOWN) { //adjusts velocity switch(event.key.keysym.sym) { case SDLK_LEFT: xVel = xVel - BALL_HEIGHT / 2; break; case SDLK_RIGHT: xVel = xVel + BALL_HEIGHT / 2; } } //when key is released else if(event.type == SDL_KEYUP) { //adjusts velocity switch(event.key.keysym.sym) { case SDLK_LEFT: xVel = xVel + BALL_HEIGHT / 2; break; case SDLK_RIGHT: xVel = xVel - BALL_HEIGHT / 2; break; } } } void Paddle::move() { //Move paddle left or right xCoord += xVel; //if moved too far if(( xCoord < 0 ) || ( xCoord + BALL_WIDTH > SCREEN_WIDTH)) { xCoord -= xVel; } } void Paddle::show() { apply_surface(xCoord, yCoord, paddle, screen); } //this function checks for collision between the ball and the paddle bool check_collision(SDL_Rect &A, SDL_Rect &B) { //sides of rectangle int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; //calculate sides of rectangle leftA = A.x; rightA = A.x + A.w; topA = A.y; bottomA = A.y + A.h; leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; //check for intersections if(bottomA <= topB) { return false; } if(topA >= bottomB) { return false; } if(rightA <= leftB) { return false; } if(leftA >= rightB) { return false; } //if no sides are outside b return true; } //main function int main(int argc, char *argv[]) { bool quit = false; Paddle playerPaddle; //Init subsystems if(Init_All() == false) { //close if initalization failed.. return 0; } //load files if(load_files() == false) { //close if failed return 0; } while(quit == false) { while(SDL_PollEvent(&event)) { //handles things for paddle playerPaddle.handle_input(); if(event.type == SDL_QUIT) { //exits game quit = true; } } //move paddle playerPaddle.move(); //Fill screen white SDL_FillRect(screen, &screen->clip_rect, SDL_MapRGB( screen->format, 0xFF, 0xFF, 0xFF)); //Show paddle playerPaddle.show(); //Update screen if(SDL_Flip(screen) == -1) { return 1; } } return 0; }