internal override void load()
        {
            base.load();

            DNode gameWorld = new DNode();

            gameWorld.position = new Vector2(size.X / 2.0f, size.Y / 2.0f);
            addChild(gameWorld);

            cameraNode = new DCameraNode();
            gameWorld.addChild(cameraNode);

            ship = new Ship
            {
                position = new Vector2(0, 148)
            };
            gameWorld.addChild(ship);

            for (int x = -4; x <= 4; x++)
            {
                for (int y = 0; y <= 5; y++)
                {
                    Alien alien = new Alien
                    {
                        position = new Vector2(43 * x, 29 * -y)
                    };
                    gameWorld.addChild(alien);
                }
            }
        }
Example #2
0
        internal override void load()
        {
            base.load();

            camera     = new DCameraNode();
            mapManager = new MapManager(0, 0);
            player     = new Player();

            gameWorld = new GameWorld();
            addChild(gameWorld);
            gameWorld.addChild(camera);
            gameWorld.addChild(mapManager);
            gameWorld.addChild(player);

            player.loadPhysics();

            mapManager.reloadMap();
        }