Conversation
pls work
| This file is not a good project README. | ||
| Replace the contents of this file before you submit your project. No newline at end of file | ||
| Instructions: | ||
| Prevent the ball from hitting the wall on your side by moving Pikachu and using it to bounce the ball back. If the ball hits the wall on your side, your opponent gets a point. The first Pikachu/player to accumulate five points will win the game! |
There was a problem hiding this comment.
Y'all don't mention quite how to start the program/what the program's requirements are. (mentioning how to run the program, e.g. something as simple as saying that once python + pygame are installed you can call python pokemon_pong.py, would be good)
| self.ball.move_ip(self.dx, self.dy) | ||
|
|
||
| def collision_wall(self): | ||
| #instances if ball hits a wall |
There was a problem hiding this comment.
From a gameplay standpoint, it might be nice to either briefly pause, or wait for user response, to continue the game (so that after losing a point, the next one doesn't immediately fire off).
| self.ball.center = (600,600) | ||
| self.dx = -1*self.dx | ||
| elif self.rect.left <= 0: | ||
| p2_score() |
There was a problem hiding this comment.
I recommend referencing objects, or calling the objects' functions (ask me in-person if this is unclear), rather than using global functions and variables.
| self.pikac.centery = window_height / 2.0 #setting starting location | ||
| self.pikac.right = window_width | ||
|
|
||
| def move_pika2(self,key): |
There was a problem hiding this comment.
You seem like you were just about to make this generalizable -- move_pika2 is basically the same as the parent class function move_pika, just checking for different keys!
| pika.pikac.centery = window_height / 2.0 | ||
| pika2.pikac.centery = window_height / 2.0 | ||
|
|
||
| '''main''' |
There was a problem hiding this comment.
To clarify what the "main" functionality is, I recommend putting this in an if statement -- so, something like
if __name__ == "__main__":
| pongball.set_ball() | ||
| pongball.collision_wall() | ||
| #makes the ball bounce in another direction if it collides with a pikachu | ||
| if pygame.sprite.collide_rect(pongball, pika) or pygame.sprite.collide_rect(pongball, pika2): |
There was a problem hiding this comment.
It might be nice to check this in a function or something, akin to pongball.collision_wall(), but I understand just checking for collision rectangles here.
No description provided.