Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[pyrecious @ Arch-1:inform@tiker.net--2004-public%pyrecious--mainline…
…--1.0--patch-2]

Fix some things.
  • Loading branch information
Andreas Kloeckner committed Oct 24, 2006
1 parent ad9e5fd commit f5305be
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pyrecious
Expand Up @@ -403,13 +403,21 @@ class tOpponentTimedGame(tGame):
def __init__(self):
tGame.__init__(self)
self.Level = 0
self.nextLevel()

self.LevelLabel = tLabel((10,130), "")
self.StonesLabel = tLabel((10,150), "")
self.OpponentWarningLabel = tLabel((10,170), "")
self.nextLevel()
UI.add(self.LevelLabel)

def gameOver(self):
self.GameEnded = True
self.Field.blowUp()
tTimer(3, self.end )
SOUND_GAME_OVER.get().play()

self.MovesLeftLabel.setText("GAME OVER")

def nextLevel(self):
self.Level += 1
self.StonesToDestroy = 30
Expand All @@ -423,12 +431,14 @@ class tOpponentTimedGame(tGame):

def step(self, seconds):
if self.Field.isUIEnabled():
if len(self.Field.hints()) == 0:
self.gameOver()
self.OpponentTimeCounter -= seconds
if self.OpponentTimeCounter < 0 and len(self.Field.hints()) > 0:
self.OpponentMove = True
self.Field.executeMove(self.Field.hints()[ 0 ])

def updateLabels():
def updateLabels(self):
self.LevelLabel.setText("Level: %d" % self.Level)
self.LevelLabel.setText("Level: %d" % self.Level)

Expand Down

0 comments on commit f5305be

Please sign in to comment.