def onMouseDown(self, event): if event.button is 1: Camera.current_camera.get_component('CameraTrackingBehavior').target = Game.camera_to_world(event.pos) c = Crosshair(ResourceLoader.load('data//crosshair.png')) c.position = Game.camera_to_world(event.pos) self.add(c)
def onMouseDown(self, event): if event.button == 1: num_puffs = 8.0 for i in range(int(num_puffs) + 1): theta = 0 + (360 * (i / num_puffs)) e = PuffEmitter(2000) e.position = Vector2D(Game.camera_to_world(event.pos)) e.velocity = Vector2D.from_angle(theta) * -180.0 self.add(e)
def onMouseDown(self, event): if event.button is 1: sprite = self.pool.getNextAvailable() sprite.position = Game.camera_to_world(event.pos)
def is_time_up(self): return Game.time() > self.__time_up
def reset(self): self.__time_up = Game.time() + self.__interval