def on_throw(self): # время полёта в одну сторону подобрано в ручную local_ttl = 1.2 FlyingGuitar.static_init( game=self.game, position=(self.position[0] + self.faceToTarget(100), self.position[1] - 100), velocity=(self.faceToTarget(2000), 0), angularVelocity=(self.faceToTarget(720)), sprite="rc/img/fg-girl-guitar.png", ttl=local_ttl) Hurter.static_init(game=self.game, owner=self, position=(self.position[0] + self.faceToTarget(100), self.position[1] - 100), velocity=(self.faceToTarget(2000), 0), ttl=local_ttl, damage=12, radius=100, level=11, type_='guitar') self.game.scheduleAfter( local_ttl, lambda: Hurter.static_init( game=self.game, owner=self, position=(self.position[0] + self.faceToTarget(100 + 2500), self.position[1] - 100), velocity=(-self.faceToTarget(2000), 0), ttl=local_ttl, damage=12, radius=100, level=11, type_='guitar')) ssound.Play('rc/snd/chainsaw.wav') self.consoleInfo('throw')
def on_hit(self): Hurter.static_init(game=self.game, owner=self, position=self.position, velocity=(self.faceToTarget(2000), 0), ttl=0.150, damage=5, radius=16, level=1, type_='hit') ssound.Play('rc/snd/hit.wav') self.consoleInfo('strike')
def on_smash(self): Hurter.static_init(game=self.game, owner=self, position=(self.position[0] + self.faceToTarget(100), self.position[1] + 200), velocity=(self.faceToTarget(1000), -2000), ttl=0.3, damage=15, radius=100, level=1, type_='smash') ssound.Play('rc/snd/smash.wav') self.consoleInfo('smashing')
def on_jump(self): ssound.Play('rc/snd/hu.wav')