Beispiel #1
0
 def update(self):
     self.tweener.updateTween()
     if self.collidePoint(self.x, self.y, Input.mouseX, Input.mouseY):
         if Input.check(mouse.Left):
             self.graphic.text = ">" + self.text + "<\n"
         elif Input.released(mouse.Left):
             if self.callback:
                 self.callback()
                 self.world.remove(self)
         else:
             self.graphic.text = ">  " + self.text + "  <\n"
     else:
         self.graphic.text = self.text + "\n"
     self.graphic.origin(self.graphic.width / 2, self.height / 2)
Beispiel #2
0
 def attack(self):
     if Input.check(mouse.Left) and self.shoot_timer <= 0:
         self.shoot_sfx.Play()
         self.shoot_timer = self.shoot_timer_reset
         b = bullets.bull_player(self.x, self.y, self.angle)
         self.world.add(b)