예제 #1
0
                             Point(1, 0)))
            self.c = False
            self.shit = self.shit - 1
        if not Keyboard.isKeyDown(Keyboard.KEY_RIGHT) and not self.c:
            self.c = True
        if Keyboard.isKeyDown(Keyboard.KEY_LEFT) and self.d and self.shit > 0:
            ESG.addEntity(
                AIThrownShit(Point(-(self.pos.x + 25), -(self.pos.y)), 1,
                             Point(-1, 0)))
            self.d = False
            self.shit = self.shit - 1
        if not Keyboard.isKeyDown(Keyboard.KEY_LEFT) and not self.d:
            self.d = True


ESG.setImage("healthbar", "resources/images/healthbar.png")
ESG.setImage("healthrect", "resources/images/healthrect.png")
ESG.setImage("grass", "resources/images/grass.png")
ESG.setImage("void", "resources/images/void.png")
ESG.setImage("happysheep", "resources/images/happysheep.png")
ESG.setImage("player", "resources/images/farmer.png")
ESG.setImage("shit", "resources/images/shit.png")
ESG.setImage("bigshit", "resources/images/bigshit.png")
ESG.setImage("evilsheep", "resources/images/angrysheep.png")
ESG.setImage("corpse", "resources/images/corpse.png")
ESG.setImage("verticalfence", "resources/images/verticalfence.png")
ESG.setImage("horizontalfence", "resources/images/horizontalfence.png")

ESG.setPlayer(Player(Point(-64, -64), 1))

ESG.addEntity(AIHappySheep(Point(-128, -128)))
        if not Keyboard.isKeyDown(Keyboard.KEY_DOWN) and not self.b:
            self.b = True
        if Keyboard.isKeyDown(Keyboard.KEY_RIGHT) and self.c and self.shit > 0:
            ESG.addEntity(AIThrownShit(Point(-(self.pos.x-20), -(self.pos.y)), 1, Point(1, 0)))
            self.c = False
            self.shit = self.shit - 1
        if not Keyboard.isKeyDown(Keyboard.KEY_RIGHT) and not self.c:
            self.c = True
        if Keyboard.isKeyDown(Keyboard.KEY_LEFT) and self.d and self.shit > 0:
            ESG.addEntity(AIThrownShit(Point(-(self.pos.x+25), -(self.pos.y)), 1, Point(-1, 0)))
            self.d = False
            self.shit = self.shit - 1
        if not Keyboard.isKeyDown(Keyboard.KEY_LEFT) and not self.d:
            self.d = True

ESG.setImage("healthbar", "resources/images/healthbar.png")
ESG.setImage("healthrect", "resources/images/healthrect.png")
ESG.setImage("grass", "resources/images/grass.png")
ESG.setImage("void", "resources/images/void.png")
ESG.setImage("happysheep", "resources/images/happysheep.png")
ESG.setImage("player", "resources/images/farmer.png")
ESG.setImage("shit", "resources/images/shit.png")
ESG.setImage("bigshit", "resources/images/bigshit.png")
ESG.setImage("evilsheep", "resources/images/angrysheep.png")
ESG.setImage("corpse", "resources/images/corpse.png")
ESG.setImage("verticalfence", "resources/images/verticalfence.png")
ESG.setImage("horizontalfence", "resources/images/horizontalfence.png")

ESG.setPlayer(Player(Point(-64, -64), 1))

ESG.addEntity(AIHappySheep(Point(-128, -128)))