Beispiel #1
0
 def movedonkey(self,game):
         game.resetperson(self)
         if random.randint(1,2)==1:
                 self.moveleft()
                 if game.checkwall(self.getxcordinate(),self.getycordinate()):
                         self.moveright()
         else:
                 self.moveright()
                 if game.checkwall(self.getxcordinate()-1,self.getycordinate())==False:
                         self.moveleft()
         game.setcoins()
         game.setperson(self)
Beispiel #2
0
        def moveright_player(self,game):
            game.resetperson(self)
            if game.checkwall(self.getxcordinate(),self.getycordinate()-1):
                pass
            else :
                self.moveright()
		game.setperson(self)
		self.checkair(game)
		game.resetperson(self)
            if game.checkcoins(self.getxcordinate(),self.getycordinate()):
                    game.coins[self.getxcordinate()][self.getycordinate()]=" "
                    self.score+=5
                    game.setcoins()