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

            //GoToLevel(++_currentLevel);
        }
Ejemplo n.º 2
0
        public ChangeLevelForm()
        {
            InitializeComponent();

            _sokoban = new Sokoban();
            levelCollectionGrid.AutoGenerateColumns = false;
        }
Ejemplo n.º 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);
    }
Ejemplo n.º 4
0
    private void restart()
    {
        Sokoban sokoban = driver.getActiveSokoban();
        Board   board   = sokoban.getBoard();

        board.removeFromBoard();
        board.restoreStartSituation();
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     sokobans = new ArrayList();
     setUpSokobans();
     connectSpacePlayer();
     activeSokoban = (Sokoban)sokobans [0];
     inSpace       = false;
     buttonManager = FindObjectOfType <ButtonManager> ();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 11
0
 public void setActiveSokoban(Sokoban sokoban)
 {
     activeSokoban = sokoban;
 }
Ejemplo n.º 12
0
 public StepsCounter(Sokoban game)
 {
     game.OnTurn          += StepForward;
     game.RevertTurnEvent += StepBack;
     count = 0;
 }
Ejemplo n.º 13
0
        public PitFall(Sokoban sokoban)
        {
            Character = '~';

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