Example #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _sokoban = new Sokoban();
            _sokoban.LevelCompleted += new EventHandler(OnLevelCompleted);

            //GoToLevel(++_currentLevel);
        }
Example #2
0
        public ChangeLevelForm()
        {
            InitializeComponent();

            _sokoban = new Sokoban();
            levelCollectionGrid.AutoGenerateColumns = false;
        }
Example #3
0
    private void setUpSokoban(Vector3 placeInWorld, string levelPath, bool newPlayer, Vector3 camPosition, Vector3 camForward)
    {
        Sokoban sokoban = new Sokoban(placeInWorld, levelPath, newPlayer, this);

        sokoban.setMainCamStartPosition(camPosition);
        sokoban.setMainCamStartForward(camForward);
        sokobans.Add(sokoban);
    }
Example #4
0
    private void restart()
    {
        Sokoban sokoban = driver.getActiveSokoban();
        Board   board   = sokoban.getBoard();

        board.removeFromBoard();
        board.restoreStartSituation();
    }
Example #5
0
 // Use this for initialization
 void Start()
 {
     sokobans = new ArrayList();
     setUpSokobans();
     connectSpacePlayer();
     activeSokoban = (Sokoban)sokobans [0];
     inSpace       = false;
     buttonManager = FindObjectOfType <ButtonManager> ();
 }
Example #6
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            sokoban    = levelManager.GetGame(currentGame);
            counter    = new StepsCounter(sokoban);
            adapter    = new Adapter(sokoban.Map);
            currentMap = adapter.Map;

            base.Initialize();
        }
Example #7
0
    private void changeCamViewToPlayerVew()
    {
        Sokoban    sokoban  = driver.getActiveSokoban();
        Player     player   = sokoban.getPlayer();
        GameObject goPlayer = player.getGameObject();

        Camera.main.transform.position = goPlayer.transform.localPosition - 2 * goPlayer.transform.forward + Vector3.up;
        Camera.main.transform.forward  = goPlayer.transform.forward;
        Camera.main.transform.Rotate(30, 0, 0);
    }
Example #8
0
    private void land()
    {
        Sokoban sokoban = driver.getActiveSokoban();

        driver.setInSpace(false);
        driver.setMainCamToStartTranslate();
        sokoban.getBoard().removeFromBoard();
        sokoban.getBoard().restoreStartSituation();
        sokoban.getPlayer().goToStartTransform();
        setPlayersSpeedZero();
        buttonManager.showSokobanButtons("land");
        hideObject();
    }
Example #9
0
        static void Main(string[] args)
        {
            //JogoGalo temp = new JogoGalo();

            //if (temp is IBoard)
            //{
            //    IBoard b = (IBoard)temp;
            //    Console.WriteLine(b.print());
            //}

            //Console.ReadKey();
            Sokoban sok = new Sokoban(8, 8);

            sok.generateRandom();
            Console.WriteLine(sok.print());


            while (sok.GameIsRunning)
            {
                ConsoleKeyInfo key        = Console.ReadKey();
                MoveType       returnMove = sok.placeMove(key);
                switch (returnMove)
                {
                case MoveType.JogadaOK:
                    Console.WriteLine("Jogada válida!");
                    break;

                case MoveType.JogadaNOK:
                    Console.WriteLine("Jogada inválida!");
                    break;

                case MoveType.Won:
                    Console.WriteLine("Ganhou!");
                    break;

                case MoveType.Loose:
                    Console.WriteLine("Perdeu!");
                    break;

                case MoveType.InvalidBoard:
                    Console.WriteLine("Tabuleiro Inválido!");
                    break;
                }

                Console.WriteLine(sok.print());
            }

            Console.ReadKey();
        }
Example #10
0
 IGameMatch IQuestHandler.QuestSelected(int leaguesID, int roundsID, Sokoban.Model.GameDesk.IQuest quest, GameMode gameMode)
 {
     Debug.WriteLine("Selected game mode: " + gameMode.ToString());
     Debug.WriteLine(quest.WholeQuestXml);
     return null;
 }
Example #11
0
 public void setActiveSokoban(Sokoban sokoban)
 {
     activeSokoban = sokoban;
 }
Example #12
0
 public StepsCounter(Sokoban game)
 {
     game.OnTurn          += StepForward;
     game.RevertTurnEvent += StepBack;
     count = 0;
 }
Example #13
0
        public PitFall(Sokoban sokoban)
        {
            Character = '~';

            Sokoban = sokoban;
        }
Example #14
0
 private void GetNewLevel()
 {
     currentGame++;
     sokoban = levelManager.GetGame(currentGame);
     counter = new StepsCounter(sokoban);
 }