/// <summary> /// Play the Shot animation and spawn a beam on the targetting position. /// </summary> /// <param name="position"></param> public void Shot(Vector2 position) { flipbook.AppendAnimationIntoCycle(thorStatePresets[ActorFlipbookState.ShootingS1], true); flipbook.AppendAnimationIntoCycle(thorStatePresets[ActorFlipbookState.Active]); SpecialEffectBuilder.ThorShot((cannonPosition + position) / 2, beamColor, (float)Helper.EuclideanDistance(cannonPosition, position) / 256, (float)Helper.AngleBetween(cannonPosition, position) - MathHelper.PiOver2); }
public void ChangeState(SatelliteFlipbookState NewState) { if (SatelliteFlipbookState == NewState) { return; } SatelliteFlipbookState = NewState; Flipbook.AppendAnimationIntoCycle(new List <AnimationInstance>() { StatePresets[SatelliteFlipbookState] }, true); }