-
Notifications
You must be signed in to change notification settings - Fork 1
/
object.py
44 lines (36 loc) · 1.26 KB
/
object.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pygame import *
import os
ICON_DIR = os.path.dirname(__file__) # Полный путь к каталогу с файлами
class Object(sprite.Sprite):
def __init__(self, x, y):
sprite.Sprite.__init__(self)
self.color = "#000000"
self.image = Surface((self.widht, self.height))
self.image.fill(Color(self.color))
self.rect = Rect(x, y, self.widht, self.height)
class FinishLine(Object):
def __init__(self, x, y):
self.widht = 64
self.height = 640
Object.__init__(self,x,y)
self.image = image.load("%s/images/finish.png" % ICON_DIR)
class Snowflake(Object):
def __init__(self, x, y):
self.widht = 32
self.height = 32
Object.__init__(self,x,y)
self.image = image.load("%s/images/snowflake.png" % ICON_DIR)
class FlagRed(Object):
def __init__(self, x, y):
self.widht = 300
self.height = 16
Object.__init__(self,x,y)
self.image = image.load("%s/images/flagRed.png" % ICON_DIR)
class FlagBlue(Object):
def __init__(self, x, y):
self.widht = 300
self.height = 16
Object.__init__(self,x,y)
self.image = image.load("%s/images/flagBlue.png" % ICON_DIR)