public bool updateLevel(XNACS1Lib.XNACS1Lib.GamePadSupport.AllButtonsOnGamePad pad, 
			XNACS1Lib.XNACS1Lib.GamePadSupport.ThumbSticksOnGamePad thumbs)
        {
            hero.UpdateHero(thumbs.Left);
            Vector2 newRoom = rooms[(int)currentRoom.X, (int)currentRoom.Y].updateRoom(hero);

            if (newRoom.X > -1) {
                unLoadRoom();
                currentRoom = newRoom;
                loadRoom();
            }

            XNACS1Base.EchoToTopStatus("Hero has " + hero.NumTimesCaught + " live(s)");
            return false;
        }
Esempio n. 2
0
        public bool updateLevel(XNACS1Lib.XNACS1Lib.GamePadSupport.AllButtonsOnGamePad pad, 
			XNACS1Lib.XNACS1Lib.GamePadSupport.ThumbSticksOnGamePad thumbs, Hero hero)
        {
            Vector2 newRoom = new Vector2(-1, -1);
                if (rooms[(int)currentRoom.X, (int)currentRoom.Y].heroCaught || paused) {

                    if (ticker > 0) {
                        paused = true;
                        ticker--;
                    }

                    else {
                        paused = false;
                        rooms[(int)currentRoom.X, (int)currentRoom.Y].heroCaught = false;
                        ticker = 80;
                    }

                }

                else if (loads == loadState.notLoading) {
                    hero.UpdateHero(thumbs.Left);

                    newRoom = rooms[(int)currentRoom.X, (int)currentRoom.Y].updateRoom(hero, levelNum);
                    if (newRoom.X > -1) {
                        loads = loadState.loading;
                        if (newRoom.X > currentRoom.X)
                            currentDirection = loadDirection.right;

                        else if (newRoom.X < currentRoom.X)
                            currentDirection = loadDirection.left;

                        else if (newRoom.Y > currentRoom.Y)
                            currentDirection = loadDirection.top;

                        else
                            currentDirection = loadDirection.bottom;

                        lastVisitedRoom = currentRoom;
                        currentRoom = newRoom;
                        loadRoom(hero);

                        expectedOrigin = new Vector2(currentRoom.X * 100f, currentRoom.Y * ((9f / 16f) * 100f));

                    }
                }
            if (loads == loadState.loading) {
                hero.Visible = false;
                moveRoom();
            }

            if(loads == loadState.finished){
                hero.Visible = true;
                unLoadRoom();
                loads = loadState.notLoading;
                currentDirection = loadDirection.noDirection;
                currentOrigin = expectedOrigin;

            }

            if(rooms[(int)currentRoom.X, (int)currentRoom.Y].stairsInRoom()){
                if (hero.Collided(rooms[(int)currentRoom.X, (int)currentRoom.Y].stairs) && rooms[(int)currentRoom.X, (int)currentRoom.Y].stairs.available)
                    return true;
            }
            return false;
        }
        public bool updateLevel(XNACS1Lib.XNACS1Lib.GamePadSupport.AllButtonsOnGamePad pad, 
			XNACS1Lib.XNACS1Lib.GamePadSupport.ThumbSticksOnGamePad thumbs)
        {
            Vector2 newRoom = new Vector2(-1, -1);
            if(loads == loadState.notLoading){
                hero.UpdateHero(thumbs.Left);
                newRoom = rooms[(int)currentRoom.X, (int)currentRoom.Y].updateRoom(hero);

            }

            if (newRoom.X > -1) {
                loads = loadState.loading;
                if (newRoom.X > currentRoom.X)
                    currentDirection = loadDirection.right;

                else if (newRoom.X < currentRoom.X)
                    currentDirection = loadDirection.left;

                else if (newRoom.Y > currentRoom.Y)
                    currentDirection = loadDirection.top;

                else
                    currentDirection = loadDirection.bottom;

                lastVisitedRoom = currentRoom;
                currentRoom = newRoom;
                loadRoom();

                expectedOrigin = new Vector2(currentRoom.X * 100f, currentRoom.Y * ((9f/16f)* 100f));

            }

            if (loads == loadState.loading) {
                hero.Visible = false;
                moveRoom();
            }

            if(loads == loadState.finished){
                hero.Visible = true;
                unLoadRoom();
                loads = loadState.notLoading;
                currentDirection = loadDirection.noDirection;
                currentOrigin = expectedOrigin;

            }

            //XNACS1Rectangle Screen;
            //if (hero.NumTimesCaught == 0)
            //{
            //    Screen = new XNACS1Rectangle(new Vector2(currentOrigin.X + 50f, currentOrigin.Y +25f), 100f, 54f);
            //    Screen.Label = "GAME OVER";
            //    Screen.LabelColor = Color.White;
            //    }
            //XNACS1Base.EchoToTopStatus("Hero has " + hero.NumTimesCaught + " live(s)");

            if(rooms[(int)currentRoom.X, (int)currentRoom.Y].stairsInRoom()){
                if (hero.Collided(rooms[(int)currentRoom.X, (int)currentRoom.Y].stairs))
                    return true;
            }
            return false;
        }