I am teaching myself XNA and only started a few days ago. I am making a clone of Pong and have made a class for the Paddle:
I am wondering how I can create 2 paddles one for each player from the one class.
Thanks,
TeaBelliedTitch
You need to create two different instances of the class.
I suggest you not to check for input inside your class but in your game loop, so you can handle events for both instances. Pseudocode below:
Pong::Paddle player1(texture1, bounds1);
Pong::Paddle player2(texture2, bounds2);
while(running){
if(keyDown == W)
player1.setYDirection(-1);
else if(keyDown == UP)
player2.setDirection(-1);
else if(keyDown == S)
player1.setYDirection(1);
else if(keyDown == DOWN)
player2.setDirection(1);
player1.update();
player2.update();
}