-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtile.py
More file actions
17 lines (14 loc) · 664 Bytes
/
Copy pathtile.py
File metadata and controls
17 lines (14 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pygame
from settings import *
class Tile(pygame.sprite.Sprite):
def __init__(self, pos, groups):
super().__init__(groups)
try:
self.image = pygame.image.load('./graphics/test/rock.png').convert_alpha()
except FileNotFoundError:
try:
self.image = pygame.image.load('/home/spencer/PythonAdventure/graphics/test/rock.png').convert_alpha()
except FileNotFoundError:
self.image = pygame.image.load('$HOME/PythonAdventure/graphics/test/rock.png').convert_alpha()
self.rect = self.image.get_rect(topleft=pos)
self.hitbox = self.rect.inflate(0, -10)