OOps, that is my bad, as I thought that part didn't get posted, so I just added it real fast. lol.
My code is WAY to long to post here. I will post as much information as I can without just over crowding it.
void Player1Scored(){ player1_score++; Uint8* KeysHeld = SDL_GetKeyState(0); do { Draw_Text("Player 1 has scored!", 24, 100, 500, 255, 255, 255, 0, 0, 0); Draw_Text("Press Space to continue.", 12, 100, 160, 255, 255, 255, 0, 0, 0); ballXVel=0; ballYVel=0; ball_position.x=WINDOW_WIDTH/2; ball_position.y=WINDOW_HEIGHT/2; ball_position.w=WINDOW_WIDTH/2; ball_position.h=WINDOW_HEIGHT/2; SDL_Flip(SDL_GetVideoSurface()); if(KeysHeld[SDLK_SPACE]) { ball_position.x=WINDOW_WIDTH/2; ball_position.y=WINDOW_HEIGHT/2; ball_position.w=WINDOW_WIDTH/2; ball_position.h=WINDOW_HEIGHT/2; KeysHeld[SDLK_SPACE] = 0; } score = false; } while(score);}void Player2Scored(){ player2_score++; Uint8* KeysHeld = SDL_GetKeyState(0); do { Draw_Text("Player 2 has scored!", 24, 100, 500, 255, 255, 255, 0, 0, 0); Draw_Text("Press Space to continue.", 12, 100, 560, 255, 255, 255, 0, 0, 0); ballXVel=0; ballYVel=0; ball_position.x=WINDOW_WIDTH/2; ball_position.y=WINDOW_HEIGHT/2; ball_position.w=WINDOW_WIDTH/2; ball_position.h=WINDOW_HEIGHT/2; SDL_Flip(SDL_GetVideoSurface()); if(KeysHeld[SDLK_SPACE]) { ball_position.x=WINDOW_WIDTH/2; ball_position.y=WINDOW_HEIGHT/2; ball_position.w=WINDOW_WIDTH/2; ball_position.h=WINDOW_HEIGHT/2; KeysHeld[SDLK_SPACE] = 0; } score = false; } while(score);}void Player2Win(){ ballXVel=0; ballYVel=0; boxYVel=0; Uint8* KeysHeld = SDL_GetKeyState(0); Draw_Text("Congradulations Player 2! You have won!", 24, 50, 200, 255, 244, 55, 0, 0, 0); Draw_Text("Thank you for playing!", 12, 80, 230, 255, 244, 55, 0, 0, 0); Draw_Text("(Q)uit Game", 12, 100, 300, 255, 244, 55, 0, 0, 0); player1_score=0; player2_score=0; SDL_Flip(SDL_GetVideoSurface()); }void Player1Win(){ ballXVel=0; ballYVel=0; boxYVel=0; Uint8* KeysHeld = SDL_GetKeyState(0); Draw_Text("Congradulations Player 1! You have won!", 24, 50, 200, 255, 244, 55, 0, 0, 0); Draw_Text("Thank you for playing!", 12, 80, 230, 255, 244, 55, 0, 0, 0); Draw_Text("(Q)uit Game", 12, 100, 300, 255, 244, 55, 0, 0, 0); player1_score=0; player2_score=0; SDL_Flip(SDL_GetVideoSurface()); }
if (ball_position.x + ball_position.w == WINDOW_WIDTH) { Player1Scored(); if(player1_score==5) { Player1Win(); } missle_dest.x=paddle1_destination.x; missle_dest.y=paddle1_destination.y; missle_dest.w=paddle1_destination.w; missle_dest.h=paddle1_destination.h; boxYVel=0; box_dest.x=WINDOW_WIDTH/2; box_dest.y=WINDOW_HEIGHT/2; box_dest.w=WINDOW_WIDTH/2; box_dest.h=WINDOW_HEIGHT/2; continue; } if (ball_position.x < 0) { Player2Scored(); if(player2_score==5) { Player2Win(); } missle2_dest.x=paddle2_destination.x; missle2_dest.y=paddle2_destination.y; missle2_dest.w=paddle2_destination.w; missle2_dest.h=paddle2_destination.h; boxYVel=0; box_dest.x=WINDOW_WIDTH/2; box_dest.y=WINDOW_HEIGHT/2; box_dest.w=WINDOW_WIDTH/2; box_dest.h=WINDOW_HEIGHT/2; continue; }
I have gotten one thing of my error list. I really only have one more thing to do after this, then the game is done! YEA! lol.
Like I said, I am sure this is just a simple mistake.
Chad.