public GameWorld()
        {
            hero = new Hero();
            player = new Player(hero);
            infoPanel = new InfoPanel(hero);
            eManager = new EnemyManager(hero);
            laser = new Laser(hero);

            stop = false;
            accelerationTimer = new Timer(15);
            SpeedReference = StartSpeed;
            Speed = SpeedReference;

            onscreen = new Queue<GameWorldRegion>();
            upcoming = new Queue<GameWorldRegion>();

            // set the enemy manager for the weapon
            hero.setEnemies(eManager.getEnemies());

            // first element on screen
            onscreen.Enqueue(new Space(hero, eManager.getEnemies(), leftEdge));

            // fill the rest of the exisiting screen
            while (onscreen.Last().rightEdge() <= rightEdge)
            {
                onscreen.Enqueue(nextElement(onscreen));
            }

            // prep upcoming elements
            upcoming.Enqueue(nextElement(onscreen));
        }
Example #2
0
        public GameWorld()
        {
            hero      = new Hero();
            player    = new Player(hero);
            infoPanel = new InfoPanel(hero);
            eManager  = new EnemyManager(hero);
            laser     = new Laser(hero);

            stop = false;
            accelerationTimer = new Timer(15);
            SpeedReference    = StartSpeed;
            Speed             = SpeedReference;

            onscreen = new Queue <GameWorldRegion>();
            upcoming = new Queue <GameWorldRegion>();

            // set the enemy manager for the weapon
            hero.setEnemies(eManager.getEnemies());

            // first element on screen
            onscreen.Enqueue(new Space(hero, eManager.getEnemies(), leftEdge));

            // fill the rest of the exisiting screen
            while (onscreen.Last().rightEdge() <= rightEdge)
            {
                onscreen.Enqueue(nextElement(onscreen));
            }

            // prep upcoming elements
            upcoming.Enqueue(nextElement(onscreen));
        }