void SetAsteroidSpawn(float location) { GameObject asteroids = GameObject.Find("Asteroids"); RandomAsteroid script = asteroids.GetComponent <RandomAsteroid>(); script.xSpawn = location; }
void Toggle_AsteroidSpawn() { GameObject asteroids = GameObject.Find("Asteroids"); RandomAsteroid asteroidScript = asteroids.GetComponent <RandomAsteroid>(); // toggle spawning asteroids asteroidScript.enabled = !asteroidScript.enabled; }
void SwitchStatus() { GameStatus script = gameManager.GetComponent <GameStatus> (); script.ToggleStatus(); // toggle spawning asteroids RandomAsteroid asteroidScript = asteroids.GetComponent <RandomAsteroid>(); asteroidScript.SpawnAsteroids = !asteroidScript.SpawnAsteroids; }
public void SwitchStatus() { GameObject gameManager = GameObject.Find("GameManager"); GameStatus script = gameManager.GetComponent <GameStatus> (); script.ToggleStatus(); // toggle spawning asteroids GameObject asteroids = GameObject.Find("Asteroids"); RandomAsteroid asteroidScript = asteroids.GetComponent <RandomAsteroid>(); asteroidScript.SpawnAsteroids = !asteroidScript.SpawnAsteroids; // toggle boss spawn }
public override void Initialize() { var frames = new Dictionary <string, Rectangle>(); for (int i = 0; i < AsteroidCount; i++) { var randomAsteroid = new RandomAsteroid(); RandomAsteroids.Add(randomAsteroid); frames.Add(i.ToString(), new Rectangle(randomAsteroid.FramePosition.ToPoint(), new Point(32))); } Sheet = new SpriteSheet(frames) { Path = "Image/gamesheetExtended" }; //Add(new AsteroidScreenBehaviour(Sheet)); base.Initialize(); }
void SetDifficultyValue() { RandomEnemies eScript = enemies.GetComponent <RandomEnemies> (); RandomAsteroid rScript = asteroids.GetComponent <RandomAsteroid> (); SetShootSpawn(); switch (gameDifficulty) { case "Easy": difficultyValue = 1; // Enemies eScript.minSpawnTime = 2.5f; eScript.maxSpawnTime = 3.5f; // Asteroids rScript.minSpawnTime = 1.5f; rScript.maxSpawnTime = 2.0f; break; case "Medium": difficultyValue = 2; // Enemies eScript.minSpawnTime = 1.5f; eScript.maxSpawnTime = 2.5f; // Asteroids rScript.minSpawnTime = 1f; rScript.maxSpawnTime = 1.5f; break; case "Hard": difficultyValue = 3; // Enemies eScript.minSpawnTime = 1f; eScript.maxSpawnTime = 1.5f; // Asteroids rScript.minSpawnTime = 0.75f; rScript.maxSpawnTime = 1.25f; break; } }
void IncreaseAsteroidSpawn() { RandomAsteroid rScript = asteroids.GetComponent <RandomAsteroid> (); // for Min spawn Easy and Medium over .05 if (rScript.minSpawnTime > 0.5f && gameDifficulty != "Hard") { rScript.minSpawnTime -= .025f; } // for Hard over .25 else if (rScript.minSpawnTime > 0.25f && gameDifficulty == "Hard") { rScript.minSpawnTime -= .025f; } // for Max spawn Easy and Medium over .05 if (rScript.maxSpawnTime > 0.5f && gameDifficulty != "Hard") { rScript.maxSpawnTime -= .025f; } // for Hard over .25 else if (rScript.maxSpawnTime > 0.25f && gameDifficulty == "Hard") { rScript.maxSpawnTime -= .025f; } }