Ejemplo n.º 1
0
        protected override void Initialize()
        {
            //SoundEffectManger
            SoundEffectManager soundeffectmanager = new SoundEffectManager(this);
            this.Services.AddService(typeof(ISoundEffect), soundeffectmanager);
           

            //Scrolling background
            scrollingbackground = new ScrollingBackground();
            this.Services.AddService(typeof(IScrollingBackground), scrollingbackground);
            screenManager.AddScreen(scrollingbackground);         
            
            //Visualiser
            visualiser = new Visualiser();
            screenManager.AddScreen(visualiser);
            this.Services.AddService(typeof(IVisualiser), visualiser);
            
            
            //PopUp
            popupmanager = new PopUpManager();
            this.Services.AddService(typeof(IPopUpManager), popupmanager);
            screenManager.AddScreen(popupmanager);

            //HUD
            hud = new HUD();
            screenManager.AddScreen(hud);
            this.Services.AddService(typeof(IHUD), hud);

            //HookPointManger
            HookPointManager hookpointmanager = new HookPointManager();
            screenManager.AddScreen(hookpointmanager);
            
            //GameScreen
            SwingSetsGameScreen ssgs = new SwingSetsGameScreen(this);
            
            //Trail
            ssgs.trail = new Trail(this);
            this.Components.Add(ssgs.trail);

            //Menu Screen
            MainMenuScreen mainmenuscreen = new MainMenuScreen(new MusicSelectScreen(new LevelSelectScreen(ssgs)));
            screenManager.AddScreen(mainmenuscreen);
            base.Initialize();
            ssgs.LoopCompleted += hud.FireLoopCompleted;
            ssgs.LoopCompleted += visualiser.FireLoopCompleted;
            ssgs.LoopCompleted += popupmanager.FireLoopCompleted;
            ssgs.LoopCompleted += hookpointmanager.FireLoopCompleted;
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {

            base.LoadContent();
            World.EnableSubStepping = true;
            World.Gravity.Y = 32;
            //////////////////////////////////
            //Debug border
            //////////////////////////////////
            //Camera.Zoom -= .35f;
            GameScreen[] screens = ScreenManager.GetScreens();
            hookpointmanager = (HookPointManager)screens[4];

            
            /////////////////////////
            //Reset the stagemanager
            /////////////////////////
            StageManager.Reset();
            LoadStage();
            
            //////////////////////////////
            //Reset the hud
            //////////////////////////////
            iHUD.Reset((int)Level, StageManager.GetStageConditionPointCount(), StageManager.GetTotalStages(), StageManager.GetCurrentStageIndex());
            //////////////////////////////
            //Reset the hud
            //////////////////////////////
            iScrollingBackground.Reset((int)Level);

            //Border
            _border = new Border(World, this, ScreenManager.GraphicsDevice.Viewport);

            //Pause Button
            pausefont = ScreenManager.Content.Load<SpriteFont>("Fonts/menufont");
            PauseText = new Vector2(-3,12.25f);

            //hookpointmanager.DamageTaken += new DamageTakenEventHandler(this.FireDamageTaken);

            ////Swinger texture
            SwingerTexture = ScreenManager.Content.Load<Texture2D>("Common/slider");

            //Create an array to hold the data from the texture
            uint[] data = new uint[SwingerTexture.Width * SwingerTexture.Height];

            //Transfer the texture data to the array
            SwingerTexture.GetData(data);

            //Find the vertices that makes up the outline of the shape in the texture
            Vertices textureVertices = PolygonTools.CreatePolygon(data, SwingerTexture.Width, false);

        }