def onUpdate(self):
     BaseController.onUpdate(self)
     if self.health <= 0:
         Systenm.exit(0)
     if Keyboard.isKeyDown(Keyboard.KEY_UP) and self.a and self.shit > 0:
         ESG.addEntity(AIThrownShit(Point(-(self.pos.x+4), -(self.pos.y+40)), 1, Point(0, -1)))
         self.a = False
         self.shit = self.shit - 1
     if not Keyboard.isKeyDown(Keyboard.KEY_UP) and not self.a:
         self.a = True
     if Keyboard.isKeyDown(Keyboard.KEY_DOWN) and self.b and self.shit > 0:
         ESG.addEntity(AIThrownShit(Point(-(self.pos.x+4), -(self.pos.y-40)), 1, Point(0, 1)))
         self.b = False
         self.shit = self.shit - 1
     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
예제 #2
0
 def onUpdate(self):
     BaseController.onUpdate(self)
     if self.health <= 0:
         Systenm.exit(0)
     if Keyboard.isKeyDown(Keyboard.KEY_UP) and self.a and self.shit > 0:
         ESG.addEntity(
             AIThrownShit(Point(-(self.pos.x + 4), -(self.pos.y + 40)), 1,
                          Point(0, -1)))
         self.a = False
         self.shit = self.shit - 1
     if not Keyboard.isKeyDown(Keyboard.KEY_UP) and not self.a:
         self.a = True
     if Keyboard.isKeyDown(Keyboard.KEY_DOWN) and self.b and self.shit > 0:
         ESG.addEntity(
             AIThrownShit(Point(-(self.pos.x + 4), -(self.pos.y - 40)), 1,
                          Point(0, 1)))
         self.b = False
         self.shit = self.shit - 1
     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
예제 #3
0
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)))
ESG.addEntity(AIHappySheep(Point(-256, -128)))
ESG.addEntity(AIHappySheep(Point(-128, -256)))
ESG.addEntity(AIHappySheep(Point(-256, -256)))

ESG.addEntity(
    AIEvilSheep(Point(-95, 282), [
        Point(267, 229),
        Point(138, -34),
        Point(396, -418),
        Point(-147, -405),
        Point(-237, -179),
    ]))

ESG.addEntity(
    AIEvilSheep(Point(-200, 282), [
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)))
ESG.addEntity(AIHappySheep(Point(-256, -128)))
ESG.addEntity(AIHappySheep(Point(-128, -256)))
ESG.addEntity(AIHappySheep(Point(-256, -256)))

ESG.addEntity(AIEvilSheep(Point(-95, 282), [
Point(267, 229),
Point(138, -34),
Point(396, -418),
Point(-147, -405),
Point(-237, -179),
]))

ESG.addEntity(AIEvilSheep(Point(-200, 282), [
Point(267, 229),
Point(138, -34),