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?")
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!")
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!")
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
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
def examine(self): return menu.dialogue("This wall looks weak...")
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()
def examine(self): return menu.dialogue("This door is shut tight...")
def examine(self): menu.dialogue(self.message)
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!")
def examine(self): menu.dialogue("It's about to explode!") return True
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: