Esempio n. 1
0
        public bool HandleDoubleTap(Vector2 gesture, ref HudBar gameHud)
        {
            bool tappedMachineComponent = false;
            this.HandleSingleTap(gesture);

            gameHud.ShowRemoveComponentMenu(currentSelected);

            return tappedMachineComponent;
        }
Esempio n. 2
0
        void goToNextLevel()
        {
            allLevels[currentLevel].UnloadLevel();
            currentLevel++;

            // do we need to go back to the first level?
            if (allLevels.Length < currentLevel + 1)
            {
                currentLevel = 0;
            }

            allLevels[currentLevel].InitializeLevel();

            ticksUntilLevelEnd = TICKS_PER_SECOND * DELAY_AFTER_COINS;   // ten seconds once last coin is spawned until end of level.

            /*This is a quick-and-dirty fix for disappearing HUD bug...may need to clean it up later --Tony*/
            gameHud = new HudBar(this.Window.ClientBounds.Right, this.Window.ClientBounds.Bottom);
            gameHud.SetAvailableComponents(ref allLevels[currentLevel]);
                                            //.MenuButtonTextures,
                                            //allLevels[currentLevel].MenuButtonNames,
                                            //allLevels[currentLevel].ComponentCounts);
        }
Esempio n. 3
0
        protected override void InitializeWorld()
        {
            // set up touch events.
            TouchPanel.EnabledGestures = GestureType.Tap | GestureType.DoubleTap | GestureType.FreeDrag; //| GestureType.Pinch | GestureType.PinchComplete

            World.SetBackgroundColor(Color.Black);

            levelEnded = new LevelEnd();

            allLevels[0] = new Level(100f, "tallCityBackground", 0);
            allLevels[1] = new Level(100f, "tallCityBackground", 1);
            allLevels[2] = new Level(200f, "FedResAndIsland", 2);
            allLevels[3] = new Level(200f, "islandBackground", 3);

            kelvinMode = false;

            _screenWidth = this.Window.ClientBounds.Right;
            _screenHeight = this.Window.ClientBounds.Bottom;

            gameHud = new HudBar(this.Window.ClientBounds.Right, this.Window.ClientBounds.Bottom);

            this.currentGameState = GameStates.mainMenu;

            this.creditsScreen = new Credits();
            this.levelSelectScreen = new LevelSelect();
            this.mainMenuScreen = new MainMenu();
            this.mainMenuScreen.Show();

            gameModeIcon = new XNACS1Rectangle(new Vector2(90f, 150f), 20f, 20f, "fatCat"); //"KelvinHead");

            base.InitializeWorld();

            XNACS1Base.PlayBackgroundAudio("PluckyDaisy", 1.0f);
        }