-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fence.py
24 lines (21 loc) · 831 Bytes
/
Fence.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
#!/usr/bin/python3
import pygame
import os
from Target import *
class Fence(pygame.sprite.Sprite, Target):
def __init__(self,x,y,version):
pygame.sprite.Sprite.__init__(self)
Target.__init__(self,True,'fence')
image = 'fence' + str(version) + '.png'
self.targetName = 'fence'
try:
self.image= pygame.image.load(os.path.join('Images',image)).convert_alpha()
except pygame.error:
print("There is no image: " + image + ".\nLoading fence1.png")
if ERRORDISPLAY:
self.image= pygame.image.load(os.path.join('Images','fence1.png')).convert_alpha()
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
def display(self, display):
display.blit(self.image, (self.rect.x, self.rect.y))