public override void WeCollided(Core.Sprite.Sprite sprite, Core.Sprite.SpriteProperties.Directions collidedDirection, PointF CameraLocation) { Actions(sprite, collidedDirection, CameraLocation); }
public override bool OtherCollided(Core.Sprite.Sprite sprite, Core.Sprite.SpriteProperties.Directions collidedDirection, PointF CameraLocation) { Actions(sprite, collidedDirection, CameraLocation); return(false); }
public void Actions(Core.Sprite.Sprite sprite, Core.Sprite.SpriteProperties.Directions collidedDirection, PointF CameraLocation) { if (sprite.Properties.isPlayer && collidedDirection == Core.Sprite.SpriteProperties.Directions.Up) { sprite.Properties.VelocityRect.Y = -0.38f; ((Mario.SampleGame.Players.Mario)sprite).JumpLength = new RectangleF(sprite.Properties.CollisionRect.X, sprite.Properties.CollisionRect.Y - (sprite.Properties.CollisionRect.Height), sprite.Properties.CollisionRect.Width, sprite.Properties.CollisionRect.Height); ((Mario.SampleGame.Players.Mario)sprite).jumping = true; sprite.setAnimation(3); if (this.currentAnimatorIndex == 2) { setAnimation(1); this.Properties.VelocityRect.X = sprite.Properties.VelocityRect.X; return; } if (this.currentAnimatorIndex == 1) { setAnimation(2); this.Properties.VelocityRect.X = 0; return; } if (this.currentAnimatorIndex == 0) { this.Properties.VelocityRect.X = 0f; setAnimation(2); return; } } if (sprite.Properties.isPlayer && (collidedDirection == Core.Sprite.SpriteProperties.Directions.Left || collidedDirection == Core.Sprite.SpriteProperties.Directions.Right)) { if (this.Properties.Alpha == 0 && this.currentAnimatorIndex == 2) { sprite.OtherCollided(this, collidedDirection, CameraLocation); setAnimation(1); this.Properties.VelocityRect.X = sprite.Properties.VelocityRect.X; return; } if (this.Properties.Alpha == 0 && (this.currentAnimatorIndex == 1 || this.currentAnimatorIndex == 0)) { if (sprite.Properties.VelocityRect.Y < 0f) { return; } if (this.currentAnimatorIndex == 1 && sprite.Properties.VelocityRect.X != this.Properties.VelocityRect.X && this.Properties.VelocityRect.X != 0) { ((Mario.SampleGame.Players.Mario)sprite).isdead = true; } if (this.currentAnimatorIndex == 0) { ((Mario.SampleGame.Players.Mario)sprite).isdead = true; } } } if (sprite.GetType() == typeof(SampleGame.Bullets.Fire) || sprite.GetType() == typeof(SampleGame.Bullets.Bullet)) { sprite.Properties.isALive = false; Kill(); } if (sprite.GetType() == typeof(SampleGame.Materials.QuestionBlock) && sprite.Properties.VelocityRect.Y != 0) { Kill(); } if (sprite.Properties.isTile && (collidedDirection == Core.Sprite.SpriteProperties.Directions.Right || collidedDirection == Core.Sprite.SpriteProperties.Directions.Left)) { if (this.currentAnimatorIndex == 1) { this.Properties.VelocityRect.X = -this.Properties.VelocityRect.X; } else { flipMove(); } } if (sprite.GetType() == typeof(Koopa) && (this.currentAnimatorIndex == 1 || sprite.currentAnimatorIndex == 1) && (this.Properties.VelocityRect.X != 0 || sprite.Properties.VelocityRect.X != 0)) { this.Kill(); ((Koopa)sprite).Kill(); } if (sprite.GetType() == typeof(Goomba) && this.currentAnimatorIndex == 1 && this.Properties.VelocityRect.X != 0) { ((Goomba)sprite).Kill(); } }
public override bool OtherCollided(Core.Sprite.Sprite sprite, Core.Sprite.SpriteProperties.Directions collidedDirection, System.Drawing.PointF CameraLocation) { HitKontrol((Core.Material)sprite); return(true); }
public override void WeCollided(Core.Sprite.Sprite sprite, Core.Sprite.SpriteProperties.Directions collidedDirection, System.Drawing.PointF CameraLocation) { base.WeCollided(sprite, collidedDirection, CameraLocation); }