static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("Enable Autochat")); GreetingMenu = BaseMenu.AddSubMenu("Greeting Message", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("Say Greeting")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("Say Greeting In All Chat")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("Min Greeting Delay", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("Max Greeting Delay", 10, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("Message Options", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("Congratulate")); OptionsMenu.Add("sayMotivate", new CheckBox("Motivate")); OptionsMenu.Add("sayApology", new CheckBox("Apologize")); OptionsMenu.Add("saySympathy", new CheckBox("Sympathetic")); OptionsMenu.Add("sayHonor", new CheckBox("Honor Opponents")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("Min Message Delay", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("Max Message Delay", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("Minimum Interval between messages", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("EndGame Message", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("Say EndGame Message")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("Say EndGame Message In All Chat")); }
static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("Habilitar AutoChat")); GreetingMenu = BaseMenu.AddSubMenu("Saludos", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("Saludar")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("Saludar en el chat general")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("Delay mínimo en saludar", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("Delay máximo en saludar", 6, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("Opciones", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("Felicitar")); OptionsMenu.Add("sayMotivate", new CheckBox("Motivar")); OptionsMenu.Add("sayApology", new CheckBox("Disculparse")); OptionsMenu.Add("saySympathy", new CheckBox("Simpatía")); OptionsMenu.Add("sayHonor", new CheckBox("Dar honor a oponentes")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("Delay mínimo en los mensajes", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("Delay máximo en los mensajes", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("Intervalo mínimo en cada mensaje", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("Final de la partida", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("Mensaje al final de la partida")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("Mensaje al final de la partida en chat general")); }
static void setupMenu() { BaseMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower()); BaseMenu.Add("enable", new CheckBox("抵制贩卖挂机脚本")); GreetingMenu = BaseMenu.AddSubMenu("卖脚本死全家", "greetingmessage"); GreetingMenu.Add("sayGreeting", new CheckBox("卖脚本死全家")); GreetingMenu.Add("sayGreetingAllChat", new CheckBox("卖脚本死全家")); GreetingMenu.AddSeparator(); GreetingMenu.Add("sayGreetingDelayMin", new Slider("卖脚本死全家", 3, 1, 5)); GreetingMenu.Add("sayGreetingDelayMax", new Slider("卖脚本死全家", 6, 5, 10)); OptionsMenu = BaseMenu.AddSubMenu("卖脚本死全家", "messageoptions"); OptionsMenu.Add("sayCongratulate", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayMotivate", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayApology", new CheckBox("卖脚本死全家")); OptionsMenu.Add("saySympathy", new CheckBox("卖脚本死全家")); OptionsMenu.Add("sayHonor", new CheckBox("卖脚本死全家")); OptionsMenu.AddSeparator(); OptionsMenu.Add("sayMessageDelayMin", new Slider("卖脚本死全家", 2, 1, 3)); OptionsMenu.Add("sayMessageDelayMax", new Slider("卖脚本死全家", 6, 3, 10)); OptionsMenu.Add("sayMessageInterval", new Slider("卖脚本死全家", 180, 1, 600)); EndGameMenu = BaseMenu.AddSubMenu("卖脚本死全家", "endgamemessage"); EndGameMenu.Add("sayEndGame", new CheckBox("卖脚本死全家")); EndGameMenu.Add("sayEndGameAllChat", new CheckBox("卖脚本死全家")); }
public static void EndGame(this Game game, bool win) { game.CleanupComponents(); var endMenu = new EndGameMenu(game, win); endMenu.restart += game.StartGame; endMenu.menu += game.ShowMainMenu; game.Components.Add(endMenu); }
public void getScripts() { main = GameObject.Find("MainMenu").GetComponent <MainMenu>(); selectMenu = GameObject.Find("SelectStageMenu").GetComponent <StageSelectMenu>(); controls = GameObject.Find("ControlsMenu").GetComponent <ControlsMenu>(); settings = GameObject.Find("SettingsMenu").GetComponent <SettingsMenu>(); stage = GameObject.Find("StageMenu").GetComponent <StageMenu>(); play = GameObject.Find("GameManager").GetComponent <PlayMenu>(); end = GameObject.Find("EndGame").GetComponent <EndGameMenu>(); }
private void Start() { _mainController = FindObjectOfType <Main>(); _mainMenu = GetComponentInChildren <MainMenu>(); _inGameUI = GetComponentInChildren <InGameUI>(); _pauseMenu = GetComponentInChildren <PauseMenu>(); _endGameMenu = GetComponentInChildren <EndGameMenu>(); SwitchUI(UIState.MainMenu); }
private void Awake() { // ищем элементы UI _scoreUI = FindObjectOfType <ScoreUI>(); _enduranceUI = FindObjectOfType <EnduranceUI>(); _endGameMenu = FindObjectOfType <EndGameMenu>(); // подписываемся на нажатие кнопки EndGameMenu.Restart += OnRestart; // UI создается один раз DontDestroyOnLoad(this); }
//private OptionsPauseMenu _optionsPauseMenu; #endregion private void Awake() { InterfaceResources = GetComponent <InterfaceResources>(); LangManager.Instance.Init("Language"); _mainMenu = GetComponent <MainMenu>(); _optionsMenu = GetComponent <OptionsMenu>(); //_videoOptions = GetComponent<VideoOptions>(); //_gameOptions = GetComponent<GameOptions>(); _audioOptions = GetComponent <AudioOptions>(); _menuPause = GetComponent <MenuPause>(); _endGameMenu = GetComponent <EndGameMenu>(); //_optionsPauseMenu = GetComponent<OptionsPauseMenu>(); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { AudioManager.instance.playSound("game_end.wav"); Player player = collision.gameObject.GetComponent <Player>(); player.GetComponent <PlayerController>().enabled = false; player.GetComponent <Rigidbody2D>().velocity = Vector3.zero; player.GetComponent <Rigidbody2D>().angularVelocity = 0f; //Save Session ActionTracker tracker = player.GetComponent <ActionTracker>(); Debug.Log(tracker.actions.Count); GameManager.instance.sessionManager.getCurrentSession().actions.AddRange(tracker.actions); GameManager.instance.sessionManager.save(); EndGameMenu endMenu = GameObject.FindGameObjectWithTag("GameEndMenu").GetComponent <EndGameMenu>(); Session oppSession = GameManager.instance.sessionManager.getOpponentSession(); Session currSession = GameManager.instance.sessionManager.getCurrentSession(); if (oppSession == null) { endMenu.show(Result.COMPLETED, GameManager.instance.sessionManager.getCurrentSession().elapsedTime); } else { if (currSession.elapsedTime > oppSession.elapsedTime) { endMenu.show(Result.DEFEAT, GameManager.instance.sessionManager.getCurrentSession().elapsedTime); } else { endMenu.show(Result.VICTORY, GameManager.instance.sessionManager.getCurrentSession().elapsedTime); } } } }
public override void build() { base.build(); layerManager = new LayerManager(); //loadAlpha = 1; levelModel = (GameModel.levelsModels.ElementAt(GameModel.currentLevelID).behaviour as LevelBehaviour).levelModel; //loadScreen.init(content); backColor = levelModel.color; clouds = new LinkedList <Clouds>(); if (levelModel.clouds != null) { for (int i = 0; i < levelModel.clouds.Count; i++) { Clouds tempCloud = new Clouds(); tempCloud.texture = content.Load <Texture2D>(levelModel.clouds.ElementAt(i)); Vector2 temp = new Vector2((i + 1) % 2 == 0 ? -100 : 600, (float)new Random().Next(0, 50)); tempCloud.position = temp; clouds.AddLast(tempCloud); } } /*Cria as layers*/ environment = new StaticLayer("ENVIRONMENT"); for (int i = 0; i < levelModel.levelLayers.Count; i++) { environment.add(new StaticObject(levelModel.levelLayers.ElementAt(i))); } FXLayer = new Layer("FX"); BackEntityFXLayer = new Layer("BACK ENTITY FX"); entityLayer = new Layer("ENTITY LAYER"); rufus = new Rufus(400 - 30); rufus.position.Y = 200; rufus.dieCallback = endGame; entityLayer.add(rufus); /*Adiciona as layers*/ layerManager.add(environment); layerManager.add(BackEntityFXLayer); layerManager.add(entityLayer); layerManager.add(FXLayer); layerManager.init(content); baseHUD = new BaseHUD(); baseHUD.init(content); baseHUD.position.X = 6; baseHUD.position.Y = 444; baseHUD.start(); addChild(baseHUD); pauseButton = new PauseButton(pauseGame); pauseButton.init(content); pauseButton.position.X = 732; pauseButton.position.Y = 410; pauseButton.scale = new Vector2(1f); addChild(pauseButton); gameLoop = new GameLoop(content, rufus); gameLoop.beginGame(entityLayer); pause = false; comboBar = new ComboBar(rufus.setOnInvencible, rufus.setOffInvencible); comboBar.init(content); comboBar.updateScale(0); addChild(comboBar); inGameMenu = new InGameMenu(); inGameMenu.init(content, menuPlayCallback, backToMenu, reinitGame); inGameMenu.hide(); addChild(inGameMenu); endGameMenu = new EndGameMenu(); endGameMenu.init(content, menuPlayCallback, backToMenu, reinitGame, goShop, goPreGame); endGameMenu.hide(); addChild(endGameMenu); totMush = 0; rufus.collideCallback = collideCallback; //endGame(); }
static void Main(string[] args) { while (true) { points = 0; LevelEnum level = Menu.GetMenu(); object writerMutex = new object(); IBuilder builder = new ConsoleBuilder(); var mlist = new Map(level, builder); var map = mlist.getMap() as List <LinkedList <IField> >; mlist.GetElems(ref keys, ref doors, ref coins, ref exit); Console.Clear(); Console.SetWindowSize(150, 30); Console.Clear(); for (int i = 0; i < map.Count; i++) { foreach (var elem in map[i]) { if (elem is KCKProjectAPI.Path) { Console.ForegroundColor = ConsoleColor.Black; } else if (elem is Wall) { Console.ForegroundColor = ConsoleColor.Red; } Console.Write(elem); } Console.Write('\n'); } Console.ForegroundColor = ConsoleColor.White; Cursor.WriteString(map[0].Count + 3, 1, "Points: 0"); Cursor.WriteString(map[0].Count + 3, 2, "Keys: 0"); Console.ForegroundColor = ConsoleColor.White; Cursor.CursorFun(exit.x, exit.y, 'E'); foreach (var key in keys) { Console.ForegroundColor = ConsoleColor.Blue; Cursor.CursorFun(key.x, key.y, 'K'); } foreach (var door in doors) { Console.ForegroundColor = ConsoleColor.DarkGray; Cursor.CursorFun(door.x, door.y, 'D'); } Thread CoinRotateThread = new Thread(() => ThreadProcClass.ThreadProcCoin(coins, ref writerMutex)); CoinRotateThread.Start(); Console.ForegroundColor = ConsoleColor.White; Console.CursorVisible = false; Player p = new Player { X = 2, Y = 9 }; object mutex = new object(); Thread PlayerThread = new Thread(() => ThreadProcClass.ThreadProcPlayer(ref p, ref mlist, ref ownedKeys, ref keys, ref doors, ref coins, ref exit, ref writerMutex, ref points)); PlayerThread.Start(); PlayerThread.Join(); lock (writerMutex) { coins.Clear(); } Console.Clear(); EndGameMenu.getMenu(points); Console.Clear(); } }
void Awake() { instance = this; }
public static Node MenuFactory(Menus menu) { Node ret = null; switch (menu) { case Menus.None: Sound.PauseSong(); return(null); break; case Menus.HUD: ret = new HUDMenu(); ret.Name = "HUD"; break; case Menus.Pause: ret = new PauseMenu(); ret.Name = "Pause"; break; case Menus.Main: ret = new MainMenu(); ret.Name = "Main"; break; case Menus.Inventory: ret = new InventoryMenu(); ret.Name = "Inventory"; break; case Menus.Settings: ret = new SettingsMenu(); ret.Name = "Settings"; break; case Menus.Career: ret = new CareerMenu(); ret.Name = "Career"; break; case Menus.NewGame: ret = new NewGameMenu(); ret.Name = "NewGame"; break; case Menus.PressEvent: ret = new PressEventMenu(); ret.Name = "PressEvent"; break; case Menus.EndGame: ret = new EndGameMenu(); ret.Name = "EndGame"; break; case Menus.Shop: ret = new ShopMenu(); ret.Name = "Shop"; break; case Menus.RestSite: ret = new RestSiteMenu(); ret.Name = "Rest Site"; break; } Session.session.AddChild(ret); IMenu menuInstance = ret as IMenu; if (menuInstance != null) { menuInstance.Init(0, 0, 0, 0); // Assuiming these are not subMenus } if (ret == null) { GD.Print("Menu.MenuFactory returning null for " + menu); } return(ret); }