Hot answers tagged


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 ...

Only top voted, non community-wiki answers of a minimum length are eligible