AsteroidSpawner.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        // Start the coroutine that creates asteroids immediately
        StartCoroutine(CreateAsteroids());
    }

Usage Example

Example #1
0
        public override void Initialize()
        {
            base.Initialize();
            _font = Main.Instance.Content.Load <SpriteFont>("hyperspace");

            _asteroidSpawner = new AsteroidSpawner();
            _asteroidSpawner.Start();

            _spaceship = new Spaceship(new Vector2(Globals.RENDER_TARGET_WIDTH / 2, Globals.RENDER_TARGET_HEIGHT / 2));
            _spaceship.Start();

            _spaceship.died += () => Main.Instance.CurrentGameState = new GameOverState(_score);

            _asteroidSpawner.spawnedAsteroid += SpawnedAsteroid;


            Debugger.Debug("MainGame :: Initialized");
        }