コード例 #1
0
 def examine(self):
     if self.name == "ladderup":
         return menu.dialogue("Climb up?")
     elif self.name == "ladderdown":
         return menu.dialogue("Climb down?")
     elif self.name == "zone" or self.name == "zone2":
         return menu.dialogue("Enter?")
コード例 #2
0
 def examine(self):
     if self.name == "ladderup":
         return menu.dialogue("Climb up?")
     elif self.name == "ladderdown":
         return menu.dialogue("Climb down?")
     elif self.name == "zone" or self.name == "zone2":
         return menu.dialogue("Enter?")
コード例 #3
0
 def examine(self):
     """Let PC buy or decline the item"""
     bought = menu.dialogue("Buy "+str(self.name)+" for "+str(self.price)+"?")
     if bought:
         if globalvars.hero.coins >= self.price:
             globalvars.hero.coins -= self.price
             globalvars.hero.get(self)
             #self.kill()
         else:
             menu.dialogue("Not enough coins!")
コード例 #4
0
 def examine(self):
     """Let PC buy or decline the item"""
     bought = menu.dialogue("Buy " + str(self.name) + " for " +
                            str(self.price) + "?")
     if bought:
         if globalvars.hero.coins >= self.price:
             globalvars.hero.coins -= self.price
             globalvars.hero.get(self)
             #self.kill()
         else:
             menu.dialogue("Not enough coins!")
コード例 #5
0
 def examine(self):
     """PC examined this, don't do anything."""
     if self.breakable:
         menu.dialogue("This looks kinda shoddy...")
     if self.name == "vendingmachine":
         newrect = self.rect.move(0, -TILESIZE)
         for s in globalvars.solidGroup:
             if newrect.colliderect(s.rect) and type(s) == ShopItem:
                 return s.examine()
     elif self.name == "counter":
         for s in globalvars.solidGroup:
             if s is not self and self.rect.colliderect(s.rect):
                 return s.examine()
     return True
コード例 #6
0
 def examine(self):
     """PC examined this, don't do anything."""
     if self.breakable:
         menu.dialogue("This looks kinda shoddy...")
     if self.name == "vendingmachine":
         newrect = self.rect.move(0, -TILESIZE)
         for s in globalvars.solidGroup:
             if newrect.colliderect(s.rect) and type(s) == ShopItem:
                 return s.examine()
     elif self.name == "counter":
         for s in globalvars.solidGroup:
             if s is not self and self.rect.colliderect(s.rect):
                 return s.examine()
     return True
コード例 #7
0
 def examine(self):
     """PC talked to this person, show dialogue.
     Return value of last dialogue, i.e. True for 'yes'.
     """
     #global window
     answer = True
     for line in self.text:
         answer = menu.dialogue(self.name + ": " + line)
     return answer
コード例 #8
0
 def examine(self):
     """PC talked to this person, show dialogue.
     Return value of last dialogue, i.e. True for 'yes'.
     """
     #global window
     answer = True
     for line in self.text:
         answer = menu.dialogue(self.name + ": " + line)
     return answer
コード例 #9
0
 def examine(self):
     return menu.dialogue("This wall looks weak...")        
コード例 #10
0
 def examine(self):
     if globalvars.hero.keys < 1:
         return menu.dialogue("You need a key to open this door.")
     globalvars.hero.keys -= 1
     self.kill()
コード例 #11
0
 def examine(self):
     return menu.dialogue("This door is shut tight...")
コード例 #12
0
 def examine(self):
     menu.dialogue(self.message)
コード例 #13
0
 def examine(self):
     menu.dialogue(self.message)
コード例 #14
0
 def examine(self):
     if not menu.dialogue("Do you want to save the game?"):
         return True
     menu.save("save1.py", self.mapname)
     menu.dialogue("Save complete!")
コード例 #15
0
 def examine(self):
     if not menu.dialogue("Do you want to save the game?"):
         return True
     menu.save("save1.py", self.mapname)
     menu.dialogue("Save complete!")
コード例 #16
0
 def examine(self):
     return menu.dialogue("This door is shut tight...")
コード例 #17
0
 def examine(self):
     return menu.dialogue("This wall looks weak...")
コード例 #18
0
 def examine(self):
     if globalvars.hero.keys < 1:
         return menu.dialogue("You need a key to open this door.")
     globalvars.hero.keys -= 1
     self.kill()
コード例 #19
0
 def examine(self):
     menu.dialogue("It's about to explode!")
     return True
コード例 #20
0
ファイル: main.py プロジェクト: kaytoxlll/mechanical-failure
menu.title()

while True:
    if globalvars.newgame:
        # load save game
        globalvars.hero = pc.PC("Cole", CENTERCENTER)
        globalvars.heroGroup.empty()
        globalvars.heroGroup.add(globalvars.hero)
        globalvars.solidGroup.empty()
        globalvars.solidGroup.add(globalvars.hero)
        globalvars.attackGroup.empty()
        globalvars.itemGroup.empty()
        path = join(getcwd(), "savedata")
        savelist = listdir(path)
        if len(savelist) > 1:
            if menu.dialogue("Do you want to load the saved game?"):
                menu.load("save1.py")
            else:
                menu.get_name()
        else:
            menu.get_name()
        # set up groups
        world = World()
        globalvars.newgame = False

    # handle game events
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
        elif event.type == KEYDOWN:
コード例 #21
0
ファイル: main.py プロジェクト: kaytoxlll/mechanical-failure
menu.title()

while True:
    if globalvars.newgame:
        # load save game
        globalvars.hero = pc.PC("Cole", CENTERCENTER)
        globalvars.heroGroup.empty()
        globalvars.heroGroup.add(globalvars.hero)
        globalvars.solidGroup.empty()
        globalvars.solidGroup.add(globalvars.hero)
        globalvars.attackGroup.empty()
        globalvars.itemGroup.empty()
        path = join(getcwd(), "savedata")
        savelist = listdir(path)
        if len(savelist) > 1:
            if menu.dialogue("Do you want to load the saved game?"):
                menu.load("save1.py")
            else:
                menu.get_name()
        else:
            menu.get_name()
        # set up groups
        world = World()
        globalvars.newgame = False
    
    # handle game events
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
        elif event.type == KEYDOWN:
コード例 #22
0
 def examine(self):
     menu.dialogue("It's about to explode!")
     return True