protected override void SpawnEntity() { var position = Game.GetRandomPosition(); var foodBlob = new FoodBlob(Game, Physics, _stateTracker, position); Game.AddBlob(foodBlob); }
public void ShouldRemoveFoodAndReturnItsPosition() { var foodBlob = new FoodBlob(_game) { Position = new Vector(50, 50) }; _game.AddBlob(foodBlob); var position = _game.RemoveFoodAndGetSpawnPosition(); Assert.AreEqual(new Vector(50, 50), position); }
/** * function that handles spawning the food blob */ private void SpawnBlob() { // instantiate a blob GameObject blob = (GameObject)Instantiate(SpawnType, SpawnPoint, Quaternion.identity); // add an itween path to the blob path = blob.GetComponent <FollowITweenPath>(); path.nutrientSpeed = speed; // set the food blob's speed on the path blobScript = blob.GetComponent <FoodBlob>(); // get the script on the foodblob // call the function to generateenzymes on the blob blobScript.GenerateEnzymes(minNutrients, maxNutrients, availableColors); }