protected override void CustomHandleImpact(BaseEnemy enemy = null) { SpriteInstance.TextureScale = 1; if (enemy != null) { LightOrShadowSprite.AttachTo(enemy); } LightOrShadowSprite.Tween(HandleTweenerUpdate, 1, 2, SpriteInstance.AnimationChains["Impact"].TotalLength, InterpolationType.Exponential, Easing.InOut).Start(); }
public override void PostInitialize() { bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue; FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true; base.PostInitialize(); if (LightOrShadowSprite.Parent == null) { LightOrShadowSprite.CopyAbsoluteToRelative(); LightOrShadowSprite.AttachTo(this, false); } if (LightOrShadowSprite.Parent == null) { base.LightOrShadowSprite.Y = -8f; } else { base.LightOrShadowSprite.RelativeY = -8f; } if (LightOrShadowSprite.Parent == null) { base.LightOrShadowSprite.Z = -1f; } else { base.LightOrShadowSprite.RelativeZ = -1f; } base.LightOrShadowSprite.Texture = AllParticles; base.LightOrShadowSprite.LeftTexturePixel = 1019f; base.LightOrShadowSprite.RightTexturePixel = 1072f; base.LightOrShadowSprite.TopTexturePixel = 1895f; base.LightOrShadowSprite.BottomTexturePixel = 1948f; base.LightOrShadowSprite.TextureScale = 1f; base.LightOrShadowSprite.Width = 32f; base.LightOrShadowSprite.Height = 24f; base.LightOrShadowSprite.Animate = false; #if FRB_MDX LightOrShadowSprite.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.Modulate; #else base.LightOrShadowSprite.ColorOperation = FlatRedBall.Graphics.ColorOperation.Modulate; #endif base.LightOrShadowSprite.Alpha = 0.8f; base.LightOrShadowSprite.ParentRotationChangesPosition = false; base.LightOrShadowSprite.ParentRotationChangesRotation = false; if (SpriteInstance.Parent == null) { SpriteInstance.CopyAbsoluteToRelative(); SpriteInstance.AttachTo(this, false); } if (SpriteInstance.Parent == null) { base.SpriteInstance.Z = 1f; } else { base.SpriteInstance.RelativeZ = 1f; } base.SpriteInstance.TextureScale = 0.5f; base.SpriteInstance.AnimationChains = CannonProjectileAnimationChainListFile; base.SpriteInstance.CurrentChainName = "Shot"; base.SpriteInstance.Visible = true; base.SpriteInstance.ParentRotationChangesPosition = false; if (mCircleInstance.Parent == null) { mCircleInstance.CopyAbsoluteToRelative(); mCircleInstance.AttachTo(this, false); } if (CircleInstance.Parent == null) { base.CircleInstance.X = 0f; } else { base.CircleInstance.RelativeX = 0f; } if (CircleInstance.Parent == null) { base.CircleInstance.Y = 0f; } else { base.CircleInstance.RelativeY = 0f; } base.CircleInstance.Radius = 16f; base.CircleInstance.Color = Microsoft.Xna.Framework.Color.Red; base.CircleInstance.ParentRotationChangesPosition = false; mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection(); mGeneratedCollision.Circles.AddOneWay(mCircleInstance); FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd; }