Skip to content

Instantly share code, notes, and snippets.

@rupython
Last active March 4, 2019 17:34
Show Gist options
  • Select an option

  • Save rupython/54eb271f92be4a2489bad5df4d969c9e to your computer and use it in GitHub Desktop.

Select an option

Save rupython/54eb271f92be4a2489bad5df4d969c9e to your computer and use it in GitHub Desktop.
From: Сергей
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