Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new FlameCreature.
        /// </summary>
        public FlameCreature()
        {
            // Animations
            IdleAnimation = new FlameMoveAnimation();
            MoveAnimation = new FlameMoveAnimation();
            Animation = IdleAnimation;

            // Size
            Size = Animation.SpriteSheet.CellSize;
            Origin.X = (Size.X - 72) / 2;
            Origin.Y = (Size.Y - 55) / 2 + 30F;
            CollisionBox = new RectangleF(Origin.X, Origin.Y, 72, 55);

            _WaitTime = 0F;
            _HurtWaitTime = 0F;
            Velocity.X = 120F;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new TurtleCreature.
        /// </summary>
        public TurtleCreature()
        {
            // Animations
            IdleAnimation = new TurtleIdleAnimation();
            SneezeAnimation = new TurtleSneezeAnimation();
            Animation = IdleAnimation;

            // Size
            Size = Animation.SpriteSheet.CellSize;
            Origin.X = (Size.X - 72) / 2;
            Origin.Y = (Size.Y - 55) / 2 + 20;
            CollisionBox = new RectangleF(Origin.X, Origin.Y, 72, 55);

            // Start
            _SneezeTime = 0.0f;
            _IdleTime = 5.0f;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new SparkyCreature.
        /// </summary>
        public SparkyCreature()
        {
            // Animations
            IdleAnimation = new SparkyIdleAnimation();
            ElectrocuteAnimation = new SparkyElectrocuteAnimation();
            Animation = IdleAnimation;

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

            _InitialY = 0F;
            _InitialYSet = false;
            _HurtWaitTime = 0F;

            Reset();
        }
Ejemplo n.º 4
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);
        }