jeudi 31 octobre 2019

How to make a player move to a random X Position?

I want to develop my first game, but I have the problem that I don´t know how to make my player move to a random X Position. Instead of "0" (down) at Food.MoveTo(0, Game.SceneBounds.Top); it should be something that makes my player move to a random position.

      if(Food.Position.Y <= Game.SceneBounds.Bottom + Turtle.Size.Height / + 10 && Food.Position.X != Turtle.Position.X)
           {
               Food.MoveTo(0, Game.SceneBounds.Top);
                lives--;
           }



Aucun commentaire:

Enregistrer un commentaire