private void MainForm_Load(object sender, EventArgs e) { _sokoban = new Sokoban(); _sokoban.LevelCompleted += new EventHandler(OnLevelCompleted); //GoToLevel(++_currentLevel); }
public ChangeLevelForm() { InitializeComponent(); _sokoban = new Sokoban(); levelCollectionGrid.AutoGenerateColumns = false; }
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); }
private void restart() { Sokoban sokoban = driver.getActiveSokoban(); Board board = sokoban.getBoard(); board.removeFromBoard(); board.restoreStartSituation(); }
// Use this for initialization void Start() { sokobans = new ArrayList(); setUpSokobans(); connectSpacePlayer(); activeSokoban = (Sokoban)sokobans [0]; inSpace = false; buttonManager = FindObjectOfType <ButtonManager> (); }
/// <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(); }
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); }
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(); }
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(); }
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; }
public void setActiveSokoban(Sokoban sokoban) { activeSokoban = sokoban; }
public StepsCounter(Sokoban game) { game.OnTurn += StepForward; game.RevertTurnEvent += StepBack; count = 0; }
public PitFall(Sokoban sokoban) { Character = '~'; Sokoban = sokoban; }
private void GetNewLevel() { currentGame++; sokoban = levelManager.GetGame(currentGame); counter = new StepsCounter(sokoban); }