Example #1
0
 /// <summary>
 /// Creates a new BombEntity.
 /// </summary>
 /// <param name="start"></param>
 public BombEntity()
 {
     CanCollide = true;
     Animation = new PlayerIdleAnimation();
     Size = Animation.SpriteSheet.CellSize;
     Size = Size * 0.5F;
     Origin.X = (Size.X - 72) / 2;
     Origin.Y = (Size.Y - 55) / 2;
     CollisionBox = new RectangleF(Origin.X, Origin.Y, 72, 55);
 }
Example #2
0
        /// <summary>
        /// Creates a new PlayerCreature.
        /// </summary>
        public PlayerCreature()
        {
            Health = 100;
            _PreviousY = GlobalCollisionBox.Bottom;
            Name = "player";
            _Won = false;

            // Animations
            IdleAnimation = new PlayerIdleAnimation();
            LeftAnimation = new PlayerMoveAnimation();
            LeftAnimation.FlipHorizontally = true;
            RightAnimation = new PlayerMoveAnimation();
            JumpAnimation = new PlayerJumpAnimation();
            CelebrateAnimation = new PlayerCelebrateAnimation();
            DieAnimation = new PlayerDieAnimation();
            ExplodeAnimation = new PlayerExplodeAnimation();
            Animation = IdleAnimation;

            // Size
            Size = Animation.SpriteSheet.CellSize;
            Origin.X = (Size.X - 72) / 2;
            Origin.Y = (Size.Y - 55) / 2;

            // Speed
            LeftSpeed = -400F;
            RightSpeed = 400F;
            JumpSpeed = -1100F;

            //Timer
            SlowTimer = 0;

            // Input
            LeftKey = new List<Keys>();
            RightKey = new List<Keys>();
            JumpKey = new List<Keys>();
            LeftKey.Add(Keys.A);
            LeftKey.Add(Keys.Left);
            RightKey.Add(Keys.D);
            RightKey.Add(Keys.Right);
            JumpKey.Add(Keys.W);
            JumpKey.Add(Keys.Up);
            JumpKey.Add(Keys.Space);
        }