Skip to content

Commit

Permalink
fixed bug causing overflowing hourglass
Browse files Browse the repository at this point in the history
  • Loading branch information
BinkyToo committed Dec 7, 2014
1 parent 526119a commit 0fff545
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WorldView.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def splash(message, fontsize=40, icon=None):
elif state == 'loading':
loadingicon = pygame.Surface(HourGlass.get_size())
loadingicon.fill(BLACK)
scaledprogress = self.progress*loadingicon.get_height()
scaledprogress = self.progress*loadingicon.get_height()*0.5
loadingiconrect = loadingicon.get_rect()
upperrect = ((loadingiconrect.left, loadingiconrect.top+scaledprogress), (loadingiconrect.width, loadingiconrect.centery-scaledprogress))
lowerrect = ((loadingiconrect.left, loadingiconrect.bottom-scaledprogress), loadingiconrect.midright)
Expand All @@ -44,10 +44,10 @@ def splash(message, fontsize=40, icon=None):
pygame.draw.line(loadingicon, DARKYELLOW, loadingiconrect.center, (loadingiconrect.centerx+random.randint(-3, 3), loadingiconrect.height))
loadingicon.blit(HourGlass, (0, 0))
splash("Loading "+mapdef['name'], 25, loadingicon)
if self.progress < 1:
self.progress += 0.02
if self.progress < 1.0:
self.progress += 0.05
else:
self.progress = 0
self.progress = 0.0
elif state == 'crashed':
splash("Game crashed!")
return self.scrollpos
Expand Down

0 comments on commit 0fff545

Please sign in to comment.