-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTables.py
More file actions
31 lines (29 loc) · 927 Bytes
/
Tables.py
File metadata and controls
31 lines (29 loc) · 927 Bytes
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
import pygame as py
class Tables(py.sprite.Sprite):
def __init__(self, image, x, y, width, height):
super().__init__()
self.image = image
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
self.height = height
self.width = width
self.mask = py.mask.from_surface(self.image)
def location(self):
return (self.x, self.y)
def updatePosition(self, dx, dy):
self.rect.x += dx
self.rect.y += dy
class TableLegs(py.sprite.Sprite):
def __init__(self, image, x, y):
super().__init__()
self.image = image
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
self.mask = py.mask.from_surface(self.image)
def location(self):
return (self.x, self.y)
def updatePosition(self, dx, dy):
self.rect.x += dx
self.rect.y += dy