protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); mAxisAlignedRectangleInstance = new FlatRedBall.Math.Geometry.AxisAlignedRectangle(); mAxisAlignedRectangleInstance.Name = "mAxisAlignedRectangleInstance"; mBallCatchArea = new FlatRedBall.Math.Geometry.Circle(); mBallCatchArea.Name = "mBallCatchArea"; SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; // this provides default controls for the platformer using either keyboad or 360. Can be overridden in custom code: this.InitializeInput(); BeforeGroundMovementSet += (newValue) => { if (mGroundMovement != null && mGroundMovement == mValuesJumpedWith) { mValuesJumpedWith = newValue; } }; BeforeAirMovementSet += (newValue) => { if (mAirMovement != null && mAirMovement == mValuesJumpedWith) { mValuesJumpedWith = newValue; } }; BeforeAfterDoubleJumpSet += (newValue) => { if (mAfterDoubleJump != null && mAfterDoubleJump == mValuesJumpedWith) { mValuesJumpedWith = newValue; } }; AfterGroundMovementSet += (not, used) => UpdateCurrentMovement(); AfterAirMovementSet += (not, used) => UpdateCurrentMovement(); AfterAfterDoubleJumpSet += (not, used) => UpdateCurrentMovement(); PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); mCollisionCircle = new FlatRedBall.Math.Geometry.Circle(); mCollisionCircle.Name = "mCollisionCircle"; mKickIndicatorInstance = new Soccer.Entities.KickIndicator(ContentManagerName, false); mKickIndicatorInstance.Name = "mKickIndicatorInstance"; SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; BulletShadow = new FlatRedBall.Sprite(); BulletShadow.Name = "BulletShadow"; MissileTrailInstance = new GreasyPlatypusSlapper.Entities.Effects.MissileTrail(ContentManagerName, false); MissileTrailInstance.Name = "MissileTrailInstance"; PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; TurretInstance = new GreasyPlatypusSlapper.Entities.Turret(ContentManagerName, false); TurretInstance.Name = "TurretInstance"; TankShadow = new FlatRedBall.Sprite(); TankShadow.Name = "TankShadow"; SmokeInstance = new GreasyPlatypusSlapper.Entities.Effects.Smoke(ContentManagerName, false); SmokeInstance.Name = "SmokeInstance"; PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; InitializeInput(); if (TopDownValues?.Count > 0) { mCurrentMovement = TopDownValues.Values.FirstOrDefault(); } PossibleDirections = PossibleDirections.FourWay; mTopDownAnimationLayer = new TopDown.DirectionBasedAnimationLayer(); mTopDownAnimationLayer.TopDownEntity = this; PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected override void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); mSpriteInstance = new FlatRedBall.Sprite(); mSpriteInstance.Name = "mSpriteInstance"; mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; LightSprite = new FlatRedBall.Sprite(); LightSprite.Name = "LightSprite"; // Not instantiating for AxisAlignedRectangle AxisAlignedRectangleInstance in Entities\Enemies\Rabbit2Enemy because properties on the object prevent it base.InitializeEntity(addToManagers); if (SpriteInstance.Parent == null) { SpriteInstanceXReset = SpriteInstance.X; } else { SpriteInstanceXReset = SpriteInstance.RelativeX; } if (SpriteInstance.Parent == null) { SpriteInstanceYReset = SpriteInstance.Y; } else { SpriteInstanceYReset = SpriteInstance.RelativeY; } if (SpriteInstance.Parent == null) { SpriteInstanceZReset = SpriteInstance.Z; } else { SpriteInstanceZReset = SpriteInstance.RelativeZ; } if (SpriteInstance.Parent == null) { SpriteInstanceXVelocityReset = SpriteInstance.XVelocity; } else { SpriteInstanceXVelocityReset = SpriteInstance.RelativeXVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceYVelocityReset = SpriteInstance.YVelocity; } else { SpriteInstanceYVelocityReset = SpriteInstance.RelativeYVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceZVelocityReset = SpriteInstance.ZVelocity; } else { SpriteInstanceZVelocityReset = SpriteInstance.RelativeZVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationXReset = SpriteInstance.RotationX; } else { SpriteInstanceRotationXReset = SpriteInstance.RelativeRotationX; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationYReset = SpriteInstance.RotationY; } else { SpriteInstanceRotationYReset = SpriteInstance.RelativeRotationY; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationZReset = SpriteInstance.RotationZ; } else { SpriteInstanceRotationZReset = SpriteInstance.RelativeRotationZ; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationXVelocityReset = SpriteInstance.RotationXVelocity; } else { SpriteInstanceRotationXVelocityReset = SpriteInstance.RelativeRotationXVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationYVelocityReset = SpriteInstance.RotationYVelocity; } else { SpriteInstanceRotationYVelocityReset = SpriteInstance.RelativeRotationYVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationZVelocityReset = SpriteInstance.RotationZVelocity; } else { SpriteInstanceRotationZVelocityReset = SpriteInstance.RelativeRotationZVelocity; } SpriteInstanceAlphaReset = SpriteInstance.Alpha; SpriteInstanceAlphaRateReset = SpriteInstance.AlphaRate; if (CircleInstance.Parent == null) { CircleInstanceXReset = CircleInstance.X; } else { CircleInstanceXReset = CircleInstance.RelativeX; } if (CircleInstance.Parent == null) { CircleInstanceYReset = CircleInstance.Y; } else { CircleInstanceYReset = CircleInstance.RelativeY; } if (CircleInstance.Parent == null) { CircleInstanceZReset = CircleInstance.Z; } else { CircleInstanceZReset = CircleInstance.RelativeZ; } if (CircleInstance.Parent == null) { CircleInstanceXVelocityReset = CircleInstance.XVelocity; } else { CircleInstanceXVelocityReset = CircleInstance.RelativeXVelocity; } if (CircleInstance.Parent == null) { CircleInstanceYVelocityReset = CircleInstance.YVelocity; } else { CircleInstanceYVelocityReset = CircleInstance.RelativeYVelocity; } if (CircleInstance.Parent == null) { CircleInstanceZVelocityReset = CircleInstance.ZVelocity; } else { CircleInstanceZVelocityReset = CircleInstance.RelativeZVelocity; } if (CircleInstance.Parent == null) { CircleInstanceRotationXReset = CircleInstance.RotationX; } else { CircleInstanceRotationXReset = CircleInstance.RelativeRotationX; } if (CircleInstance.Parent == null) { CircleInstanceRotationYReset = CircleInstance.RotationY; } else { CircleInstanceRotationYReset = CircleInstance.RelativeRotationY; } if (CircleInstance.Parent == null) { CircleInstanceRotationZReset = CircleInstance.RotationZ; } else { CircleInstanceRotationZReset = CircleInstance.RelativeRotationZ; } if (CircleInstance.Parent == null) { CircleInstanceRotationXVelocityReset = CircleInstance.RotationXVelocity; } else { CircleInstanceRotationXVelocityReset = CircleInstance.RelativeRotationXVelocity; } if (CircleInstance.Parent == null) { CircleInstanceRotationYVelocityReset = CircleInstance.RotationYVelocity; } else { CircleInstanceRotationYVelocityReset = CircleInstance.RelativeRotationYVelocity; } if (CircleInstance.Parent == null) { CircleInstanceRotationZVelocityReset = CircleInstance.RotationZVelocity; } else { CircleInstanceRotationZVelocityReset = CircleInstance.RelativeRotationZVelocity; } if (LightSprite.Parent == null) { LightSpriteXReset = LightSprite.X; } else { LightSpriteXReset = LightSprite.RelativeX; } if (LightSprite.Parent == null) { LightSpriteYReset = LightSprite.Y; } else { LightSpriteYReset = LightSprite.RelativeY; } if (LightSprite.Parent == null) { LightSpriteZReset = LightSprite.Z; } else { LightSpriteZReset = LightSprite.RelativeZ; } if (LightSprite.Parent == null) { LightSpriteXVelocityReset = LightSprite.XVelocity; } else { LightSpriteXVelocityReset = LightSprite.RelativeXVelocity; } if (LightSprite.Parent == null) { LightSpriteYVelocityReset = LightSprite.YVelocity; } else { LightSpriteYVelocityReset = LightSprite.RelativeYVelocity; } if (LightSprite.Parent == null) { LightSpriteZVelocityReset = LightSprite.ZVelocity; } else { LightSpriteZVelocityReset = LightSprite.RelativeZVelocity; } if (LightSprite.Parent == null) { LightSpriteRotationXReset = LightSprite.RotationX; } else { LightSpriteRotationXReset = LightSprite.RelativeRotationX; } if (LightSprite.Parent == null) { LightSpriteRotationYReset = LightSprite.RotationY; } else { LightSpriteRotationYReset = LightSprite.RelativeRotationY; } if (LightSprite.Parent == null) { LightSpriteRotationZReset = LightSprite.RotationZ; } else { LightSpriteRotationZReset = LightSprite.RelativeRotationZ; } if (LightSprite.Parent == null) { LightSpriteRotationXVelocityReset = LightSprite.RotationXVelocity; } else { LightSpriteRotationXVelocityReset = LightSprite.RelativeRotationXVelocity; } if (LightSprite.Parent == null) { LightSpriteRotationYVelocityReset = LightSprite.RotationYVelocity; } else { LightSpriteRotationYVelocityReset = LightSprite.RelativeRotationYVelocity; } if (LightSprite.Parent == null) { LightSpriteRotationZVelocityReset = LightSprite.RotationZVelocity; } else { LightSpriteRotationZVelocityReset = LightSprite.RelativeRotationZVelocity; } LightSpriteAlphaReset = LightSprite.Alpha; LightSpriteAlphaRateReset = LightSprite.AlphaRate; }
protected virtual void InitializeEntity(bool addToManagers) { LoadStaticContent(ContentManagerName); SpriteInstance = new FlatRedBall.Sprite(); SpriteInstance.Name = "SpriteInstance"; LightOrShadowSprite = new FlatRedBall.Sprite(); LightOrShadowSprite.Name = "LightOrShadowSprite"; mCircleInstance = new FlatRedBall.Math.Geometry.Circle(); mCircleInstance.Name = "mCircleInstance"; // Not instantiating for AnimationChain AnimationChainInstance in Entities\BaseEntities\BasePlayerProjectile because properties on the object prevent it PostInitialize(); if (SpriteInstance.Parent == null) { SpriteInstanceXReset = SpriteInstance.X; } else { SpriteInstanceXReset = SpriteInstance.RelativeX; } if (SpriteInstance.Parent == null) { SpriteInstanceYReset = SpriteInstance.Y; } else { SpriteInstanceYReset = SpriteInstance.RelativeY; } if (SpriteInstance.Parent == null) { SpriteInstanceZReset = SpriteInstance.Z; } else { SpriteInstanceZReset = SpriteInstance.RelativeZ; } if (SpriteInstance.Parent == null) { SpriteInstanceXVelocityReset = SpriteInstance.XVelocity; } else { SpriteInstanceXVelocityReset = SpriteInstance.RelativeXVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceYVelocityReset = SpriteInstance.YVelocity; } else { SpriteInstanceYVelocityReset = SpriteInstance.RelativeYVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceZVelocityReset = SpriteInstance.ZVelocity; } else { SpriteInstanceZVelocityReset = SpriteInstance.RelativeZVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationXReset = SpriteInstance.RotationX; } else { SpriteInstanceRotationXReset = SpriteInstance.RelativeRotationX; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationYReset = SpriteInstance.RotationY; } else { SpriteInstanceRotationYReset = SpriteInstance.RelativeRotationY; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationZReset = SpriteInstance.RotationZ; } else { SpriteInstanceRotationZReset = SpriteInstance.RelativeRotationZ; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationXVelocityReset = SpriteInstance.RotationXVelocity; } else { SpriteInstanceRotationXVelocityReset = SpriteInstance.RelativeRotationXVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationYVelocityReset = SpriteInstance.RotationYVelocity; } else { SpriteInstanceRotationYVelocityReset = SpriteInstance.RelativeRotationYVelocity; } if (SpriteInstance.Parent == null) { SpriteInstanceRotationZVelocityReset = SpriteInstance.RotationZVelocity; } else { SpriteInstanceRotationZVelocityReset = SpriteInstance.RelativeRotationZVelocity; } SpriteInstanceAlphaReset = SpriteInstance.Alpha; SpriteInstanceAlphaRateReset = SpriteInstance.AlphaRate; if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteXReset = LightOrShadowSprite.X; } else { LightOrShadowSpriteXReset = LightOrShadowSprite.RelativeX; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteYReset = LightOrShadowSprite.Y; } else { LightOrShadowSpriteYReset = LightOrShadowSprite.RelativeY; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteZReset = LightOrShadowSprite.Z; } else { LightOrShadowSpriteZReset = LightOrShadowSprite.RelativeZ; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteXVelocityReset = LightOrShadowSprite.XVelocity; } else { LightOrShadowSpriteXVelocityReset = LightOrShadowSprite.RelativeXVelocity; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteYVelocityReset = LightOrShadowSprite.YVelocity; } else { LightOrShadowSpriteYVelocityReset = LightOrShadowSprite.RelativeYVelocity; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteZVelocityReset = LightOrShadowSprite.ZVelocity; } else { LightOrShadowSpriteZVelocityReset = LightOrShadowSprite.RelativeZVelocity; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationXReset = LightOrShadowSprite.RotationX; } else { LightOrShadowSpriteRotationXReset = LightOrShadowSprite.RelativeRotationX; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationYReset = LightOrShadowSprite.RotationY; } else { LightOrShadowSpriteRotationYReset = LightOrShadowSprite.RelativeRotationY; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationZReset = LightOrShadowSprite.RotationZ; } else { LightOrShadowSpriteRotationZReset = LightOrShadowSprite.RelativeRotationZ; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationXVelocityReset = LightOrShadowSprite.RotationXVelocity; } else { LightOrShadowSpriteRotationXVelocityReset = LightOrShadowSprite.RelativeRotationXVelocity; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationYVelocityReset = LightOrShadowSprite.RotationYVelocity; } else { LightOrShadowSpriteRotationYVelocityReset = LightOrShadowSprite.RelativeRotationYVelocity; } if (LightOrShadowSprite.Parent == null) { LightOrShadowSpriteRotationZVelocityReset = LightOrShadowSprite.RotationZVelocity; } else { LightOrShadowSpriteRotationZVelocityReset = LightOrShadowSprite.RelativeRotationZVelocity; } LightOrShadowSpriteAlphaReset = LightOrShadowSprite.Alpha; LightOrShadowSpriteAlphaRateReset = LightOrShadowSprite.AlphaRate; if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { // Generated Initialize LoadStaticContent(ContentManagerName); AnimSprite = AnimationChainListFile; mBody = new FlatRedBall.Math.Geometry.Circle(); EntireScene = EnemySpriteScene.Sprites.FindByName("testsprite32x321").Clone(); mHead = new FlatRedBall.Math.Geometry.Circle(); PathArea = new FlatRedBall.Math.Geometry.AxisAlignedRectangle(); PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { // Generated Initialize LoadStaticContent(ContentManagerName); EntireScene = SceneFile.Clone(); for (int i = 0; i < EntireScene.Texts.Count; i++) { EntireScene.Texts[i].AdjustPositionForPixelPerfectDrawing = true; } mBody = new FlatRedBall.Math.Geometry.Circle(); InstructionText = new FlatRedBall.Graphics.Text(); PostInitialize(); if (addToManagers) { AddToManagers(null); } }
protected virtual void InitializeEntity(bool addToManagers) { // Generated Initialize LoadStaticContent(ContentManagerName); Sprite = new FlatRedBall.Sprite(); mCollision = new FlatRedBall.Math.Geometry.Circle(); PostInitialize(); if (addToManagers) { AddToManagers(null); } }
public static bool CollideAgainstBounce(this ICollidable thisInstance, Circle other, float thisMass, float otherMass, float elasticity) { return(thisInstance.Collision.CollideAgainstBounce(other, thisMass, otherMass, elasticity)); }
public static bool CollideAgainstMove(this ICollidable thisInstance, Circle other, float thisMass, float otherMass) { return(thisInstance.Collision.CollideAgainstMove(other, thisMass, otherMass)); }
public static bool CollideAgainst(this ICollidable thisInstance, Circle other) { return(thisInstance.Collision.CollideAgainst(other)); }