1
Fork 0

added different types of targets

This commit is contained in:
Jake Howard 2015-05-07 19:50:57 +01:00
parent a352c41651
commit 6715733162

View file

@ -1,5 +1,6 @@
import pygame
class Target(pygame.sprite.Sprite):
def __init__(self, x, y, color=(30,0,150), width=16, height=16):
super().__init__()
@ -10,10 +11,13 @@ class Target(pygame.sprite.Sprite):
self.rect = self.image.get_rect()
self.speed = 10
self.rect.x, self.rect.y = (x+(self.width/2)),(y+(self.width/2)) # centres co-ordinates
self.type = "NORMAL"
def move(self):
self.rect.x += self.speed
def drop(self):
self.rect.y += 20
self.speed *= -1