public void GameStarted(UInt16 spawnIndex) { //do something with it MapManager.Position pos = MapManager.getCoordinates(spawnIndex); gameManager.StartGame(); uiManager.GameStartedUI(); }
public void GameLoop() { /* * MapManager.Position P2Position = MapManager.getCoordinates(Convert.ToUInt16(currentRoom.game._currentLocationP2)); * * currentRoom.game._currentLocationP1 = currentRoom.game.ReturnNewIndex(currentRoom.game.P1Direction, currentRoom.game._currentLocationP1); * MapManager.Position P1Position = MapManager.getCoordinates(Convert.ToUInt16(currentRoom.game._currentLocationP1)); * * playerRef.transform.position = new Vector3(P1Position.x, playerRef.transform.position.y, -P1Position.y); * enemyRef.transform.position = new Vector3(P2Position.x, enemyRef.transform.position.y, -P2Position.y); */ if (player1Blocks.Count != currentRoom.game._P1blocks.Count) { GameObject temp = (GameObject)Instantiate(PlayerPrefab, Vector3.zero, Quaternion.identity); player1Blocks.Add(temp); } if (player2Blocks.Count != currentRoom.game._P2blocks.Count) { GameObject temp = (GameObject)Instantiate(OpponentPrefab, Vector3.zero, Quaternion.identity); player2Blocks.Add(temp); } for (int i = 0; i < currentRoom.game._P1blocks.Count; i++) { MapManager.Position P1Position = MapManager.getCoordinates(currentRoom.game._P1blocks[i]); player1Blocks[i].transform.position = new Vector3(P1Position.x, player1Blocks[0].transform.position.y, -P1Position.y); } for (int i = 0; i < currentRoom.game._P2blocks.Count; i++) { MapManager.Position P2Position = MapManager.getCoordinates(currentRoom.game._P2blocks[i]); player2Blocks[i].transform.position = new Vector3(P2Position.x, player2Blocks[0].transform.position.y, -P2Position.y); } MapManager.Position bugP1Position = MapManager.getCoordinates(currentRoom.game.bugLocationP1); player1Bug.transform.position = new Vector3(bugP1Position.x, player1Blocks[0].transform.position.y, -bugP1Position.y); MapManager.Position bugP2Position = MapManager.getCoordinates(currentRoom.game.bugLocationP2); player2Bug.transform.position = new Vector3(bugP2Position.x, player2Blocks[0].transform.position.y, -bugP2Position.y); }
public void SetSpawnPoint(byte x, byte y) { spawnPoint = new MapManager.Position(x, y); }