Exemplo n.º 1
0
 /// <summary>
 /// Set boundaries for random movements
 /// </summary>
 protected async void MoveRandomly(float minX, float maxX, float minY, float maxY, float duration)
 {
     while (IsAlive)
     {
         var moveAction = new MoveBy(duration, new Vector3(RandomHelper.NextRandom(minX, maxX), RandomHelper.NextRandom(minY, maxY), 0));
         await Node.RunActionsAsync(moveAction, moveAction.Reverse());
     }
 }
Exemplo n.º 2
0
 async void MoveRandomly()
 {
     while (IsAlive)
     {
         var moveAction = new MoveBy(0.75f, new Vector3(RandomHelper.NextRandom(-0.4f, 0.4f), RandomHelper.NextRandom(-0.3f, 0.3f), 0));
         await Node.RunActionsAsync(moveAction, moveAction.Reverse());
     }
 }