Ejemplo n.º 1
0
 public void Update(RPGGame game)
 {
     if (Input.GetKeyDown(KeyCode.LeftArrow))
     {
         game.velocity -= WALK_ACCELERATION;
         Debug.Log(" game velocity= " + game.velocity.ToString());
     }
     if (Input.GetKeyDown(KeyCode.RightArrow))
     {
         game.velocity += WALK_ACCELERATION;
         Debug.Log(" game velocity= " + game.velocity.ToString());
     }
 }
Ejemplo n.º 2
0
        public void Update(RPGGame game)
        {
            //Handle Graphics...

            if (game == null || game.graphicsX == null)
            {
                return;
            }

            Sprite sprite = spriteStand;

            if (game.velocity < 0)
            {
                sprite = spriteWalkLeft;
            }
            else if (game.velocity > 0)
            {
                sprite = spriteWalkRight;
            }
            game.graphicsX.Draw(sprite, game.x, game.y);
        }
Ejemplo n.º 3
0
        public void Update(RPGGame game)
        {
            game.x += game.velocity;

            //Handle Physics...
        }