예제 #1
0
        public GameModeScene(IGameScreenManager manager)
            : base(manager)
        {
            services = (SCSServices)manager.Game.Services.GetService(typeof(SCSServices));

            resourceManager = (IResourceManager)manager.Game.Services.GetService(typeof(IResourceManager));
        }
예제 #2
0
        public StringDebuger(Game game)
            : base(game)
        {
            dict = new Dictionary<String, Vector2>();

            services = (SCSServices)game.Services.GetService(typeof(SCSServices));
            font = game.Content.Load<SpriteFont>("debug");
        }
예제 #3
0
        public TBGamePlayScene(IGameScreenManager manager)
            : base(manager)
        {
            services = (SCSServices)manager.Game.Services.GetService(typeof(SCSServices));

            resourceManager = (IResourceManager)manager.Game.Services.GetService(typeof(IResourceManager));

            GameManager = new GameManagerImpl(manager.Game);
            Components.Add(GameManager);

            InputLayer = new DefaultInputLayer(manager.Game);
            InputLayer.onInit();
        }
예제 #4
0
        public void onInit()
        {
            services = (SCSServices)Game.Services.GetService(typeof(SCSServices));
            resourceManager = (IResourceManager)Game.Services.GetService(typeof(IResourceManager));

            controller = new Controller(Game);
            controller.onInit();

            btnSpace = new Button(Game, services.SpriteBatch, resourceManager.GetResource<Texture2D>(Shared.Resources.ctrlButtonSpace), resourceManager.GetResource<Texture2D>(Shared.Resources.ctrlButtonSpace));
            btnSpace.Canvas.Bound.Position = new Vector2(622, 392);
            btnSpace.FitSizeByImage();

            controller.OnLeftFreeTap += new ControlEventHandler(btnUp_OnLeftFreeTap);
            controller.OnRightFreeTap += new ControlEventHandler(controller_OnRightFreeTap);
            controller.OnUpFreeTap += new ControlEventHandler(controller_OnUpFreeTap);
            controller.OnDownFreeTap += new ControlEventHandler(controller_OnDownFreeTap);

            btnSpace.OnPressed += new ButtonEventHandler(btnSpace_onClick);

            dispatcher.AddTarget(controller);

            controlManager.Add(btnSpace);
        }
예제 #5
0
 public static void Initialize(Game game)
 {
     BoomMissionManager = new TBBoomMissionManager(game);
     Game = game;
     Services = (SCSServices)game.Services.GetService(typeof(SCSServices));
     ResourceManager = (IResourceManager)game.Services.GetService(typeof(IResourceManager));
 }
예제 #6
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            scsServices = new SCSServices(this, spriteBatch);
            Services.AddService(typeof(SCSServices), scsServices);

            IResourceManager resourceManager = new SCSResourceManager(this.Content);
            this.Services.AddService(typeof(IResourceManager), resourceManager);

            StringDebuger debuger = new StringDebuger(this);
            Components.Add(debuger);

            Global.isMusicOff = SaveLoadGame.LoadSoundVolume();

            // Global
            Global.Initialize(this);
            Components.Add(Global.BoomMissionManager);

            // Init Grid
            Grid.Grid.game = this;

            // Init Gesture Manager and initialize detector
            Global.GestureManager = DefaultGestureHandlingFactory.Instance.CreateManager(this);
            DefaultGestureHandlingFactory.Instance.InitDetectors(Global.GestureManager);

            // Init all game factory
            InitFactory();
            AddSpriteData();

            // Begin with Choose Scene
            BoomGame.Scene.MenuScene menu = Global.BoomMissionManager.Bank.GetScreen(Shared.Macros.S_MENU, true) as BoomGame.Scene.MenuScene;
            menu.onInit();
            Global.BoomMissionManager.AddExclusive(menu);
        }
예제 #7
0
 public Button(Game game, ISprite background)
     : base(game)
 {
     this.services = game.Services.GetService(typeof(SCSServices)) as SCSServices;
     this.Background = background;
 }
예제 #8
0
 public virtual void onInit()
 {
     scsServices = (SCSServices)this.Game.Services.GetService(typeof(SCSServices));
     resourceManagement = (IResourceManager)this.Game.Services.GetService(typeof(IResourceManager));
 }