-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasicSprite.py
29 lines (22 loc) · 871 Bytes
/
basicSprite.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pygame
from pygame.locals import *
import random
class Sprite(pygame.sprite.Sprite):
""" It is the most basic sprite that contains all the variable that are required by the pygame to function."""
def __init__(self, centerPoint, image):
""" Instantize the Sprite"""
pygame.sprite.Sprite.__init__(self)
self.image = image
self.rect = image.get_rect()
self.rect.center = centerPoint
class Coin(pygame.sprite.Sprite):
""" Class that denotes all the coin counting """
def __init__(self, top_left, image=None):
""" Instantize the coin data."""
pygame.sprite.Sprite.__init__(self)
if image == None:
self.image, self.rect = load_image('coin.png',-1)
else:
self.image = image
self.rect = image.get_rect()
self.rect.topleft = top_left