Beispiel #1
0
        static void Main(string[] args)
        {
            Game game = new Game(1280, 780, "AsteroidGame");

            Actor root = new Actor();

            game.Root = root;

            Sprite backGround = new Sprite("background.png");

            backGround.X = 0;
            backGround.Y = 0;
            root.AddChild(backGround);

            Ship ship = new Ship(1280 / 2, 780 / 2);

            root.AddChild(ship);

            DebrisSpawner debrisSpawner = new DebrisSpawner(0, null, true);

            root.AddChild(debrisSpawner);

            //## Set up game here ##//

            game.Run();
        }
Beispiel #2
0
        public void CreateNewSpawners(float deltaTime)
        {
            if (_newSpawnerTimer.Seconds >= _timeToSpawnNewSpawner && _canSpawnMore)
            {
                //_timeToSpawnNewSpawner += 10;

                Satellite     satellite     = new Satellite();
                DebrisSpawner debrisSpawner = new DebrisSpawner(0, null, false);
                Parent.AddChild(debrisSpawner);

                _newSpawnerTimer.Restart();
            }
        }