fixed attack animation to match with range buffs
This commit is contained in:
parent
2412efcc8b
commit
dc74bf5424
BIN
dist/shattered_sword_assets/spritesheets/slice.png
vendored
BIN
dist/shattered_sword_assets/spritesheets/slice.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 213 B |
|
@ -16,15 +16,19 @@ export default class Slice extends WeaponType {
|
|||
}
|
||||
|
||||
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-
|
||||
//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.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
|
||||
//scale = num of pixels between center of sprite and atk anim
|
||||
sliceSprite.position = attacker.position.clone().add(direction.scaled(32));
|
||||
|
|
Loading…
Reference in New Issue
Block a user