Beispiel #1
0
 public Player(ContentManager Content, ParticleTools particleTools, GameUnit x, GameUnit y)
     : base(CollisionType.StickyCollision)
 {
     sprites = new Dictionary<SpriteState, Sprite>();
     InitializeSprites(Content);
     this.particleTools = particleTools;
     kinematicsX = new Kinematics(x, 0);
     kinematicsY = new Kinematics(y, 0);
     accelerationX = 0;
     horizontalFacing = SpriteState.HorizontalFacing.Left;
     intendedVerticalFacing = SpriteState.VerticalFacing.Horizontal;
     walkingAnimation = new WalkingAnimation();
     maybeGroundTile = null;
     jumpActive = false;
     playerHealth = new PlayerHealth(Content);
     interacting = false;
     invincibleTimer = new Timer(InvincibleTime);
     damageText = new FloatingNumber(Content, FloatingNumber.NumberType.Damage);
     experienceText = new FloatingNumber(Content, FloatingNumber.NumberType.Experience);
     gunExperienceHud = new GunExperienceHud(Content);
     polarStar = new PolarStar(Content);
     collisionRectangle = new CompositeCollisionRectangle(new Rectangle((int)Math.Round(CollisionTopLeft), (int)Math.Round(CollisionYTop),
         (int)Math.Round(CollisionTopWidth), (int)Math.Round(CollisionYHeight / 2)),
         new Rectangle((int)Math.Round(CollisionBottomLeft), (int)Math.Round(CollisionYTop + CollisionYHeight / 2),
         (int)Math.Round(CollisionBottomWidth), (int)Math.Round(CollisionYHeight / 2)),
         new Rectangle(6, 10, 10, 12),
         new Rectangle(16, 10, 10, 12));
 }
Beispiel #2
0
 public Player(ContentManager Content, ParticleTools particleTools, GameUnit x, GameUnit y) : base(CollisionType.StickyCollision)
 {
     sprites = new Dictionary <SpriteState, Sprite>();
     InitializeSprites(Content);
     this.particleTools     = particleTools;
     kinematicsX            = new Kinematics(x, 0);
     kinematicsY            = new Kinematics(y, 0);
     accelerationX          = 0;
     horizontalFacing       = SpriteState.HorizontalFacing.Left;
     intendedVerticalFacing = SpriteState.VerticalFacing.Horizontal;
     walkingAnimation       = new WalkingAnimation();
     maybeGroundTile        = null;
     jumpActive             = false;
     playerHealth           = new PlayerHealth(Content);
     interacting            = false;
     invincibleTimer        = new Timer(InvincibleTime);
     damageText             = new FloatingNumber(Content, FloatingNumber.NumberType.Damage);
     experienceText         = new FloatingNumber(Content, FloatingNumber.NumberType.Experience);
     gunExperienceHud       = new GunExperienceHud(Content);
     polarStar          = new PolarStar(Content);
     collisionRectangle = new CompositeCollisionRectangle(new Rectangle((int)Math.Round(CollisionTopLeft), (int)Math.Round(CollisionYTop),
                                                                        (int)Math.Round(CollisionTopWidth), (int)Math.Round(CollisionYHeight / 2)),
                                                          new Rectangle((int)Math.Round(CollisionBottomLeft), (int)Math.Round(CollisionYTop + CollisionYHeight / 2),
                                                                        (int)Math.Round(CollisionBottomWidth), (int)Math.Round(CollisionYHeight / 2)),
                                                          new Rectangle(6, 10, 10, 12),
                                                          new Rectangle(16, 10, 10, 12));
 }
Beispiel #3
0
 public FirstCaveBat(ContentManager Content, GameUnit x, GameUnit y)
 {
     sprites       = new Dictionary <BatSpriteState, Sprite>();
     this.x        = x;
     this.y        = y;
     flightCenterY = y;
     alive         = true;
     flightAngle   = 0.0f;
     facing        = CaveStory.SpriteState.HorizontalFacing.Right;
     damageText    = new FloatingNumber(Content, FloatingNumber.NumberType.Damage);
     InitializeSprites(Content);
 }
Beispiel #4
0
 public FirstCaveBat(ContentManager Content, GameUnit x, GameUnit y)
 {
     sprites = new Dictionary<BatSpriteState, Sprite>();
     this.x = x;
     this.y = y;
     flightCenterY = y;
     alive = true;
     flightAngle = 0.0f;
     facing = CaveStory.SpriteState.HorizontalFacing.Right;
     damageText = new FloatingNumber(Content, FloatingNumber.NumberType.Damage);
     InitializeSprites(Content);
 }