quit () def run ( self ): while True : self. append ( Ball ( 100 )) def handleEvents ( self ): for event in pygame. y = cord class game (): def _init_ ( self ): pygame. radius ) def update ( self ): cord = pygame. type = "player" def draw ( self, surface ): pygame. dy *= - 1 class Player : def _init_ ( self, rad = 20 ): self. type = "ball" def draw ( self, surface ): pygame. set_mode ( resolution ) class Ball : def _init_ ( self, xPos = resolution / 2, yPos = resolution / 2, xVel = 1, yVel = 1, rad = 15 ): self. Import pygame from pygame.locals import * resolution = ( 400, 300 ) white = ( 255, 255, 255 ) black = ( 0, 0, 0 ) red = ( 255, 0, 0 ) screen = pygame. dy *= - 1 class game (): def _init_ ( self ): pygame.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |