Disabled image scaling because of low quality.
This commit is contained in:
parent
fe6775531b
commit
941cb16a87
1 changed files with 9 additions and 6 deletions
|
@ -28,8 +28,6 @@ running = True
|
||||||
class Wobbler:
|
class Wobbler:
|
||||||
def __init__(self, position: tuple=(100, 100), rotation: int=0):
|
def __init__(self, position: tuple=(100, 100), rotation: int=0):
|
||||||
self.size = 1
|
self.size = 1
|
||||||
self.width = self.size
|
|
||||||
self.height = self.size
|
|
||||||
|
|
||||||
self.x, self.y = position
|
self.x, self.y = position
|
||||||
|
|
||||||
|
@ -43,6 +41,11 @@ class Wobbler:
|
||||||
|
|
||||||
self.image_original = random.choice(images)
|
self.image_original = random.choice(images)
|
||||||
|
|
||||||
|
self.max_width, self.max_height = self.image_original.get_size()
|
||||||
|
|
||||||
|
self.width = self.max_width * self.size / 100
|
||||||
|
self.height = self.max_height * self.size / 100
|
||||||
|
|
||||||
self.image = self.image_original
|
self.image = self.image_original
|
||||||
self.image = pygame.transform.scale(self.image, (self.width, self.height))
|
self.image = pygame.transform.scale(self.image, (self.width, self.height))
|
||||||
self.image_no_rot = self.image
|
self.image_no_rot = self.image
|
||||||
|
@ -53,8 +56,8 @@ class Wobbler:
|
||||||
screen.blit(self.image, self.image_rect)
|
screen.blit(self.image, self.image_rect)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self.width = self.size
|
self.width = self.max_width * self.size / 100
|
||||||
self.height = self.size
|
self.height = self.max_height * self.size / 100
|
||||||
|
|
||||||
self.image = self.image_original
|
self.image = self.image_original
|
||||||
self.image = pygame.transform.scale(self.image, (self.width, self.height))
|
self.image = pygame.transform.scale(self.image, (self.width, self.height))
|
||||||
|
|
Loading…
Reference in a new issue