fixed attack animation to match with range buffs

This commit is contained in:
OfficialCHenry 2022-04-15 17:16:30 -04:00
parent 2412efcc8b
commit dc74bf5424
2 changed files with 8 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

After

Width:  |  Height:  |  Size: 213 B

View File

@ -16,15 +16,19 @@ export default class Slice extends WeaponType {
} }
doAnimation(attacker: GameNode, direction: Vec2, extraRange:number,sliceSprite: AnimatedSprite): void { doAnimation(attacker: GameNode, direction: Vec2, extraRange:number,sliceSprite: AnimatedSprite): void {
// Rotate this with the game node
// TODO - need to rotate the anim properly
//sliceSprite.rotation = attacker.rotation;
//sliceSprite.rotation = (<Sprite>attacker).invertX? .5* Math.PI : 1.5 * Math.PI;
sliceSprite.invertX = (<Sprite>attacker).invertX;
//TODO- //TODO-
//4 to scale up the default sprite - may be different later depending on atk anim //4 to scale up the default sprite - may be different later depending on atk anim
sliceSprite.scaleX = 2*(1+extraRange); //might have to add extra range to y as well sliceSprite.scaleX = 2*(1+extraRange); //might have to add extra range to y as well
sliceSprite.scaleY = 2; sliceSprite.scaleY = 2;
// Rotate this with the game node
// TODO - need to rotate the anim properly
sliceSprite.rotation = attacker.rotation;
sliceSprite.rotation = (<Sprite>attacker).invertX? .5* Math.PI : 1.5 * Math.PI;
// Move the slice out from the player // Move the slice out from the player
//scale = num of pixels between center of sprite and atk anim //scale = num of pixels between center of sprite and atk anim
sliceSprite.position = attacker.position.clone().add(direction.scaled(32)); sliceSprite.position = attacker.position.clone().add(direction.scaled(32));