public StartScreenWorld(TwitchInterface twitchInterface) { twitchy = twitchInterface; if (Utility.MainConfig.UseBackgroundImage) { AddGraphic(new Image(Library.GetTexture("content/Background.png"))); } leaderBoard = new LeaderBoard { Y = 60 }; if (Utility.MainConfig.ShowLeaderBoard) { Add(leaderBoard); } AddResponse(Join.JoinGameMessage.JoinGame, DoJoinGame); AddResponse(Leave.LeaveMessage.Leave, DoPartGame); AddResponse(QuitGame.QuitMessage.Quit, DoQuitGame); AddResponse(Move.MoveMessage.Move, DoMoveZeeb); AddResponse(MoveD.MoveDMessage.MoveD, DoMoveDZeeb); AddResponse(Loop.LoopMessage.Loop, DoLoop); AddResponse(Change.ChangeMessage.Change, DoChangeEmote); AddResponse(Spin.SpinMessage.Spin, DoSpinZeeb); AddResponse(ChangeColor.ChangeColorMessage.ChangeColor, DoChangeColor); AddResponse(Flip.FlipMessage.Flip, DoFlipZeeb); AddResponse(Cancel.CancelMessage.Cancel, DoCancelCommands); AddResponse(Attack.AttackeMessage.Attack, DoAttack); AddResponse(WorldMessages.PlayerKilledPlayer, DoPlayerKillPlayer); AddResponse(WorldMessages.UpdateLeaderBoard, UpdateLeaderBoard); AddResponse(SaveScores.SaveScoresMessage.SaveScores, WriteAllScores); AddResponse(Kick.KickMessage.Kick, KickPlayer); start = new Text("Start [Enter]"); start.X = (FP.Width / 2) - (start.Width / 2); start.Y = (FP.Height / 3) + 25; instructions = new Text("Instructions [Space]"); instructions.X = (FP.Width / 2) - (instructions.Width / 2); instructions.Y = (FP.Height / 3) + 50; nodeGridEntity = new Entity(); nodeGridEntity.AddComponent <Grid>(nodeGrid = new Grid(FP.Width, FP.Height, TileSize, TileSize)); nodeGridEntity.Type = "ClickMap"; pathNodes = new PathNode[FP.Width / TileSize, FP.Height / TileSize]; for (int x = 0; x < pathNodes.GetLength(0); x++) { for (int y = 0; y < pathNodes.GetLength(1); y++) { pathNodes[x, y] = new PathNode(null, x * TileSize + TileSize / 2, y * TileSize + TileSize / 2, false); } } //for (int x = 0; x < pathNodes.GetLength(0); x++) // for (int y = 0; y < pathNodes.GetLength(1); y++) // PathNode.ConnectedNodes[pathNodes[x, y]] = SolverUtility.SelectTilesAroundTile(x, y, pathNodes); Utility.LoadAndProcessClickMap("content/MoveMap.png", pathNodes, nodeGrid, TileSize); Add(nodeGridEntity); //AddGraphic(start); //JsonWriter.Save( //new AnimatedEntityData //{ // Animations = new List<string> { "ZeebIdle" }, // DefaultAnimation = "ZeebIdle" //}, "MetaData"); }
void Start() { //build spawn dictionary spawnDict = new Dictionary<string, SpawnRef>(); spawnedObjects = new List<GameObject>[spawnables.Length]; for(int i = 0; i < spawnables.Length; i++) { spawnDict.Add(spawnables[i].name, new SpawnRef(spawnables[i], i)); spawnedObjects[i] = new List<GameObject>(MAXOBJECTSOFTYPE); } //make sure we have gamerules and twitchinterface if (gameRules == null) { gameRules = FindObjectOfType<GameRules>(); } if(twitchInterface == null) { twitchInterface = FindObjectOfType<TwitchInterface>(); } //set twitch interface event twitchInterface.messageReciever += OnMessage; }