Skip to content

Commit

Permalink
Fix (?) parallax issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Mathews committed Aug 21, 2011
1 parent cf8ebcd commit a277075
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def parallax(self, dx, dy):
self.rect.x -= float(dx) * 35
self.rect.y -= float(dy) * 35

if self.rect.x > 0: self.rect.x = 0
if self.rect.y > 0: self.rect.y = 0
if self.rect.x < -self.rect.width: self.rect.x = self.rect.width
if self.rect.y < -self.rect.height: self.rect.y = self.rect.height

class Image:
def __init__(self, src_file, src_x, src_y, dst_x, dst_y):
self.old_values = (src_file, src_x, src_y)
Expand Down Expand Up @@ -1169,6 +1174,10 @@ def loop(self):
self.dblurry = 0
self.set_state(States.Normal)

blackness = pygame.Surface((ABS_MAP_SIZE * 2, ABS_MAP_SIZE * 2))
blackness.set_alpha(100)
self.buff.blit(blackness, blackness.get_rect())

self.screen.blit(pygame.transform.scale(self.buff, (ABS_MAP_SIZE * 2, ABS_MAP_SIZE * 2)), self.buff.get_rect())
UpKeys.flush()
time.sleep(.02)
Expand Down
Binary file modified wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a277075

Please sign in to comment.