Exemplo n.º 1
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);

            // TODO: use this.Content to load your game content here
            Global.Content = Content;

            // Allow mouse
            //IsMouseVisible = true;
            cursor = CustomCusor.GetInstance();

            // Initialize map
            gridMap = WordGrid.GetInstance();
            //gridMap.Load(Content.Load<GridData>(Utils.GetMapFileName(Consts.DEFALT_MAP_NAME)));

            // Initialize dictionary
            dictionary = TrieDictionary.GetInstance();
            dictionary.Load(Content.Load<string[]>(Utils.GetDictionaryFileName(Consts.DEFAULT_DICTIONARY_NAME)));

            // Initialize logo panel
            logoPanel = LogoPanel.GetInstance();

            // Initialize menu
            menuContainer = MenuContainer.GetInstance();

            // Initialize background
            background = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName("Background")));

            // Initialize notification
            notification = GameNotification.GetInstance();

            // Initialize controller
            mouseController = MouseController.GetInstance();
            keyboardController = KeyboardController.GetInstance();

            // Initialize button
            backButton = new TileButton(25, 620, Utils.GetImageFileName("Back"));
            soundButton = new TileButton(70, 620, Utils.GetImageFileName("Sound"));

            // Load sound effects
            Global.clickSound = Content.Load<SoundEffect>(@"Sound\click");
            Global.achieveSound = Content.Load<SoundEffect>(@"Sound\achieve");
            Global.themeSong = Content.Load<Song>(@"Sound\theme");

            Global.UpdatePhase(Phase.MENU_LOADING);
        }
Exemplo n.º 2
0
 public static CustomCusor GetInstance()
 {
     if (instance == null)
         instance = new CustomCusor();
     return instance;
 }