So i'm looking to code pong (score will go up to 10) as my first actual game and have written out part of the pseudo code (minus the actual physics) to show the very basics of the game mechanics and just want to make sure on this super high level I'm not missing anything. I've included my pseudo code and I'm likely going to code this in C++ or C#, but if anyone thinks another language is better I am open to suggestions.
I was also curious as to whether using a pointer, class, or function would suit my needs better for storing the code for the physics part of this. I'm thinking with as simple as it should be a function may be best, but again, I am open to suggestions.
**EDIT** Realized I don't need a generic score variable and removed all references to it.
pong
paddle a - left side
paddle b - left side
int score a = 0
int score b = 0
while (score <= 10)
if (click){
send ball from one side to the other
}
else {
keep ball at paddle
}
if (ball goes past paddle b){
point to paddle a
score a = score a + 1
}
else{
send ball back to other side
}
if (ball goes past paddle a){
point to paddle b
score b = score b + 1
}
else{
send ball back to other side
}
display score a on left side
display score b on right side
if (paddle a's points = 10){
end game
player 1 wins!
}
else if (paddle b's points = 10){
end game
player 2 wins!
}
else {
continue game
}
}
Ask if player wishes to play again