Last active
March 4, 2019 17:34
-
-
Save rupython/54eb271f92be4a2489bad5df4d969c9e to your computer and use it in GitHub Desktop.
From: Сергей
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| from game_object import GameObject | |
| class Ball(GameObject): | |
| def __init__(self, x, y, r, color, speed): | |
| GameObject.__init__(self, x - r, y - r, r * 2, r * 2, speed) | |
| self.radius = r | |
| self.diameter = r * 2 | |
| self.color = color | |
| def draw(self, surface): | |
| r = pygame.draw.circle(surface, self.color, self.center, self.radius) | |
| def update(self): | |
| super().update() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment