Ejemplo n.º 1
0
        public void PlayPush()
        {
            switch (Dir)
            {
                case Direction.Left:
                    flip = SpriteEffects.FlipHorizontally;
                    currAnim = pushRight;
                    break;
                case Direction.Right:
                    currAnim = pushRight;
                    break;
                case Direction.Up:
                    currAnim = pushUp;
                    break;
                case Direction.Down:
                    currAnim = pushDown;
                    break;
            }

            currAnim.Play();
        }
Ejemplo n.º 2
0
        public void Update(GameTime time)
        {
            currAnim.Update(time);
            float t = (float)time.ElapsedGameTime.TotalSeconds;

            //scale down
            if (scaling)
            {
                scale -= 0.2f * t;
            }

            if (velocity != Vector2.Zero)
            {
                position += velocity * t;
                travelled += Math.Abs(velocity.X * t) + Math.Abs(velocity.Y * t);

                if (travelled >= dist)
                {
                    StopMove();
                    moving = false;
                }
            }
            if (!moving)
            {
                Direction onConveyor = OnConveyor();
                if (onConveyor != Direction.None)
                {
                    BeginMove(onConveyor, 1);
                }
            }
            if (RobotActions.Instance.energy <= 0 && game.GameScreen.endingTime <= 0.0f)
            {
                currAnim = die;
                currAnim.Play();
                game.GameScreen.End(EndScreen.Ending.Inaction, 4);
            }
        }
Ejemplo n.º 3
0
 public void BanjoPlay()
 {
     currAnim = banjoPlay;
     currAnim.Play();
 }