SamplyGame.Enemy.MoveRandomly C# (CSharp) Method

MoveRandomly() protected method

Set boundaries for random movements
protected MoveRandomly ( float minX, float maxX, float minY, float maxY, float duration ) : void
minX float
maxX float
minY float
maxY float
duration float
return void
		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());
			}
		}