Example #1
0
from gui.entities import Entity, Human
import gui
import os

_PATH = os.path.dirname(os.path.abspath(__file__))

gui.init()

client = Human("ludopata")
client.add_decoration("gui/assets/decoracion/bullet.png")

client.angle = 0
client.y = 0
client.x = 0
ticks = 0


def tick():
    client.x += 1
    client.y += 1
    client.angle = 1


gui.set_size(773, 485)
gui.add_entity(client)
gui.run(tick, 30)
Example #2
0
        self.building.health = 300
        self.temple = Temple("pezoa", pos=(700, 500), size=(200, 150))
        self.building.in_construction = True

        self.gold = 0

        gui.add_entity(self.unit)
        gui.add_entity(self.building)
        gui.add_entity(self.temple)

    def tick(self):
        if self.unit.health > 0:
            self.unit.cord_x += 1
            self.unit.cord_y += 0.5
            self.unit.angle += 1
            self.unit.health -= 1

        else:
            gui.set_objective("Hernán ha muerto :(")
            self.unit.show()

        self.gold += 1
        gui.set_gold_t1(self.gold)
        gui.set_gold_t2(self.gold)


sim = Sim()
gui.set_size(1024, 680)
gui.set_objective("Matar a Hernán")
gui.run(sim.tick)