Exemplo n.º 1
0
    def __init__(self):
        Entity.__init__(self, 400, 400, Image('./assets/planet.png'))
        self.graphic.origin(self.graphic.width/2, self.graphic.height/2)

        self.type = 'planet'

        self.setHitbox(80, 80, 40, 40)
Exemplo n.º 2
0
    def __init__(self, skip):
        Entity.__init__(self, 0, 0)
        self.skip = skip

        self.scorev = 0
        self.healthv = 10

        self.layer = config.layer.ui
Exemplo n.º 3
0
    def __init__(self, x, y, img):
        Entity.__init__(self)
        self.x, self.y = x, y
        self.graphic = img

        self._speed = 0
        self._angle = 0 #measured from 0 = upright N, clockwise
        self.recalc_speed()

        #centre the sprite
        self.graphic.origin(self.graphic.width/2, self.graphic.height/2)
Exemplo n.º 4
0
    def __init__(self):
        Entity.__init__(self)
        # DEM TWEENS MAN, DEM TWEENS
        self.spawn_tween = NumTween(self.increase_chance)
        self.timer_reset = 1

        # set up the random sawn chances
        self.spawn_chance = [0.005, 0.003, 0.001]
        self.enemies = [enemies.one, enemies.two, enemies.three]

        self.difficulty = 2

        self.increase_chance()
Exemplo n.º 5
0
    def __init__(self, x, y, text, callback=None):
        Entity.__init__(self, x, y)
        self.callback = callback
        self.text = text

        self.layer = config.layer.button

        self.graphic = Text(config.image.font, text + "\n", 24)
        self.graphic.origin(self.graphic.width / 2, self.height / 2)
        self.graphic.alpha = 0
        self.setHitbox(self.graphic.width, self.graphic.height, self.graphic.width / 2, self.graphic.height / 2)

        self.tweener = Tweens.VarTween()
        self.tweener.tween(self.graphic, "alpha", 1, 1, Tweens.ease_quadOut)
Exemplo n.º 6
0
    def __init__(self, x, y, img):
        Entity.__init__(self)
        self.x, self.y = x, y

        #set the graphic
        self.graphic = img
        self.graphic.origin(self.graphic.width/2, self.graphic.height/2)
        self.setHitbox(self.graphic.width, self.graphic.height, self.graphic.width/2, self.graphic.height/2)

        # enemy entities function on an angle and distance variable
        #
        # self.angle is the angle in counter-clockwise degrees that they are from 0 (towards the top of the screen),
        # measured with the origin at the centre of the screen.
        #
        # self.distance is the number of pixel units the enemy is away from the centre of the screen, at the given angle

        self.angle = random.randint(0, 360)
        self.distance = 800
Exemplo n.º 7
0
 def __init__(self):
     #Initiate Entity system
     Entity.__init__(self)