public void ConfirmSelection(int optionNum) { if (optionNum == 0) //New Game { // Set up first character for New game. charStats.CreateCharacterStats("Player", 0, 1, 70, 35, 15, 10, 5, 20); charStats.SetTileOccupied("Player", 0, new Vector2(1, 1), 8); transition.FadeToSceneChange(false, NewGameSceneID); } else if (optionNum == 1) { selectionImageGroup.SetActive(false); optionsPanel.SetActive(false); loadGamePanel.SetActive(true); state = TitleState.Load; } else if (optionNum == 2) { selectionImageGroup.SetActive(false); optionsPanel.SetActive(true); loadGamePanel.SetActive(false); UpdateVideoSettingsText(); state = TitleState.Options; } else if (optionNum == 3) { Application.Quit(); } }
public void CancelSelection() { state = TitleState.Title; selectionImageGroup.SetActive(true); optionsPanel.SetActive(false); loadGamePanel.SetActive(false); }
protected override void LoadContent() { // ============================== // -- Prepare graphic systems // ============================== spriteBatch = new SpriteBatch(GraphicsDevice); particleSystem = new ParticleSystem(); primitiveRenderer = new PrimitiveRenderer(spriteBatch); // ============================== // -- Object pre-initialization // ============================== particle = new Particle(particle1SpriteSheet); beam = new Particle(beam1SpriteSheet); // ============================== // -- Load fonts // ============================== sysFont = Content.Load <SpriteFont>(@"Fonts\System"); // ============================== // -- Load graphics // ============================== fighterSpriteSheet.Texture = Content.Load <Texture2D>(@"Sprites\Fighter1"); particle1SpriteSheet.Texture = Content.Load <Texture2D>(@"Particles\Particle1"); beam1SpriteSheet.Texture = Content.Load <Texture2D>(@"Particles\Beam1"); bulletSpriteSheet.Texture = Content.Load <Texture2D>(@"Sprites\bullet"); // ============================== // -- Object post-initialization // ============================= LoadTracks(); State = new TitleState(this, sysFont); }
void UpdateTitleState(TitleState state) { switch (state) { case TitleState.Death: mainText.text = deathTitle; break; case TitleState.Life: mainText.text = lifeTitle; break; case TitleState.Reborn: mainText.text = rebirthTitle; break; case TitleState.Escape: FlipTitleColors(true); mainText.text = escapeText; break; case TitleState.Credits0: mainText.text = credits0Text; break; case TitleState.Credits1: mainText.text = credits1Text; continueText.SetActive(false); break; } titleState = state; }
public void ChangeState(int to) { TitleState converted = (TitleState)to; //Init InitialiseAllCanvases(); InitialiseAllNavs(); switch (converted) { case TitleState.Home: break; case TitleState.Play: if (ovSearchingCo == null) { ovPlay.color = selectionColor; } break; case TitleState.Knowledge: ovKnowledge.color = selectionColor; break; case TitleState.Options: ovOptions.color = selectionColor; break; case TitleState.Community: ovCommunity.color = selectionColor; break; } ChangeCanvas(converted, true); }
public void ChangeState(TitleState _state) { StopAllCoroutines(); if (state == TitleState.Score) { ScoreManager.Instance.Obj.SetActive(false); } switch (_state) { case TitleState.Root: StartCoroutine(ChangeStateAnimation(new Vector2(0, 0))); break; case TitleState.PlaySelect: StartCoroutine(ChangeStateAnimation(new Vector2(0, -Screen.height))); break; case TitleState.Score: StartCoroutine(ChangeStateAnimation(new Vector2(-Screen.width, 0))); ScoreManager.Instance.Open("Survival05x5"); break; case TitleState.Dressup: StartCoroutine(ChangeStateAnimation(new Vector2(Screen.width, 0))); break; case TitleState.Option: StartCoroutine(ChangeStateAnimation(new Vector2(0, Screen.height))); break; } state = _state; }
public void Update() { if (menuState != TitleState.ItsFadeTime && CrossPlatformInputManager.GetButtonDown("Cancel")) { #if UNITY_WEBGL || UNITY_EDITOR if (theAudioSource.isPlaying) { theAudioSource.Pause(); } else { theAudioSource.UnPause(); } #else QuitGame(); #endif } if (menuState == TitleState.ShowingIntro) { if (Input.anyKeyDown) { menuState = TitleState.ItsFadeTime; FindObjectOfType <FaderScript>().ChangeLevel(1); } } }
// Use this for initialization void Start() { state = TitleState.INITIAL; titletext = GameObject.Find("TitleText"); instructionstext = GameObject.Find("InstructionText"); waitingtext = GameObject.Find("WaitingText"); }
static void PrintState(TitleState state) { string res = ""; if ((state & TitleState.Bold) == TitleState.Bold) { if (res.Length > 0) { res += ", "; } res += TitleState.Bold; } if ((state & TitleState.Italic) == TitleState.Italic) { if (res.Length > 0) { res += ", "; } res += TitleState.Italic; } if ((state & TitleState.Underline) == TitleState.Underline) { if (res.Length > 0) { res += ", "; } res += TitleState.Underline; } if (res.Length == 0) { res += TitleState.None; } Console.WriteLine("Параметры Надписи: {0} ", res); }
void Update() { timeElapsed += Time.deltaTime; if (Input.GetKeyUp(KeyCode.Escape)) { Application.Quit(); } if (state == TitleState.Waiting && (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2))) { // ゲームへ nextSceneName = gameSceneName; state = TitleState.FadeOut; SoundManager.PlaySE(SoundManager.SE.select); AnalyticsManager.StartSession(); } else if (state == TitleState.Waiting && timeElapsed > 60) { // 学校ロゴへ nextSceneName = logoSceneName; state = TitleState.FadeOut; } if (state == TitleState.FadeIn) { fadeIn(); } if (state == TitleState.FadeOut) { fadeOut(); } }
private void Start() { titleState = new TitleState(); button.OnClickAsObservable() .Subscribe(_ => { ScreenStateManager.Instance.GoToNextScene(0); }); }
// Start is called before the first frame update void Start() { states["Title"] = new TitleState(); states["Play"] = new PlayState(); states["NewGame"] = new NewGameState(); states["Pause"] = new PauseState(); TransitionState("Title"); }
void TransitionScene() { state = TitleState.Transitioning; TitleEventManager.Instance.StartTransition(); Invoke("TransitionToGame", 1.0f); }
void Start() { titleState = TitleState.CONTINUE_GAME; sprites.SetActive(false); camera.GetComponent <Animator>().enabled = false; isInputOK_ = false; particle.SetActive(false); }
void Awake() { /* スクリプト参照を得る */ m_PlayerPos = m_PlayerPos.transform; m_TitleState = this.gameObject.GetComponent <TitleState>(); m_MenuState = this.gameObject.GetComponent <MenuState>(); m_IsConnectedController = this.GetComponent <IsConnectedController>(); }
public void StartGame() { titleGroup.interactable = false; titleGroup.alpha = 0F; menuState = TitleState.ShowingIntro; startGameGroup.alpha = 1F; startGameGroup.gameObject.SetActive(true); }
public void ShowCredits() { titleGroup.interactable = false; titleGroup.alpha = 0F; menuState = TitleState.ShowingCredits; theCredits.gameObject.SetActive(true); theCredits.StartCredits(); }
public TitleScreen(Game1 game, string label, Texture2D font, Vector2 pos) { this.game = game; this.label = label; this.font = font; this.posi = pos; this.runState = TitleState.DisplayText; }
public void QuitGame() { if (menuState != TitleState.ItsFadeTime) { titleGroup.interactable = false; menuState = TitleState.ItsFadeTime; GameObject.FindObjectOfType <FaderScript>().FadeAndQuit(FaderScript.FadeType.BLACK, false); } }
//Constructor public TitleScreen(Texture2D logo, Texture2D options, Texture2D arrow) { this.z_logo = logo; this.z_options = options; this.z_arrow = new GameObject(arrow); //Try to fiqure the starting position for arrow ^^ this.z_arrow.setPosition(new Vector2(170, 350)); this.z_currentState = TitleState.Start; }
void Update() { if (Input.anyKeyDown && m_guideText.activeSelf) { m_titleState = TitleState.Main; soundManager.PlaySeByName("Select"); } else if (Input.GetKeyDown(KeyCode.Escape) && !m_guideText.activeSelf) { m_titleState = TitleState.None; soundManager.PlaySeByName("Select"); } switch (m_titleState) { case TitleState.None: m_guideText.SetActive(true); m_gameBar.SetActive(false); m_mainMenu.SetActive(false); m_optionMenu.SetActive(false); m_AudioMenu.SetActive(false); break; case TitleState.Main: m_guideText.SetActive(false); m_gameBar.SetActive(true); m_mainMenu.SetActive(true); m_optionMenu.SetActive(false); m_AudioMenu.SetActive(false); break; case TitleState.Option: m_gameBar.SetActive(false); m_mainMenu.SetActive(false); m_optionMenu.SetActive(true); m_AudioMenu.SetActive(false); break; case TitleState.Audio: m_gameBar.SetActive(false); m_mainMenu.SetActive(false); m_optionMenu.SetActive(false); m_AudioMenu.SetActive(true); if (!isUpdated) { GameObject.Find("MasterSlider").GetComponent <Slider>().value = SoundManager.m_masterVolume; GameObject.Find("BGMSlider").GetComponent <Slider>().value = SoundManager.m_bgmVolume; GameObject.Find("SESlider").GetComponent <Slider>().value = SoundManager.m_seVolume; isUpdated = true; Debug.Log("check"); } break; } }
protected override void Initialize() { TitleState _state = new TitleState(); _state.Game = this; _state.Initialize(); _state.LoadContent(); StateManager.ActiveState = _state; base.Initialize(); }
public static void Main(string[] args) { try { Logger.Initialize(LogLevel.ALL, true); Logger.SetOutFile(); Logger.Blacklist("AddLayer"); Logger.Blacklist("AddRule"); Logger.Blacklist("AreaAI"); Logger.Blacklist("BackgroundMusic"); Logger.Blacklist("CalculateLoS"); Logger.Blacklist("CanShift"); Logger.Blacklist("Effect"); Logger.Blacklist("Entity"); Logger.Blacklist("EventManager"); Logger.Blacklist("GameFactory"); Logger.Blacklist("IoManager"); Logger.Blacklist("LavaAI"); Logger.Blacklist("LoadTilemask"); Logger.Blacklist("LoadWorldView"); Logger.Blacklist("Main"); Logger.Blacklist("MeleeAI"); Logger.Blacklist("OnRound"); Logger.Blacklist("OutObject"); Logger.Blacklist("Run"); Logger.Blacklist("SetDungeon"); Logger.Blacklist("SetUserEvent"); Logger.Blacklist("Skill"); //Logger.Blacklist ("Simulator"); Logger.Blacklist("TestLevel"); Logger.Blacklist("TranslateAnimation"); Logger.Blacklist("WorldFactory"); Logger.Blacklist("XmlUtilities"); IoManager.Initialize("Wizards of Unica", 1280, 720); } catch (Exception ex) { Console.WriteLine("Configuration Error, Aborting: " + ex.ToString()); return; } GameState state = new TitleState(); while (true) { var inputs = IoManager.GetInputs(); if (inputs.Command == InputCommands.QUIT) { return; } state.Logic(inputs); GameState.ChangeState(ref state); state.Render(); } }
public void Awake() { menuState = TitleState.ShowingTitle; startGameGroup.alpha = 0F; titleGroup.alpha = 1f; titleGroup.interactable = true; startGameGroup.gameObject.SetActive(false); theCredits.gameObject.SetActive(false); }
/// <summary> /// Sends AddTitle(Knowledge) to creature's client, /// depending on state. /// </summary> /// <param name="creature"></param> /// <param name="titleId"></param> /// <param name="state"></param> public static void AddTitle(Creature creature, ushort titleId, TitleState state) { var op = (state == TitleState.Known ? Op.AddTitleKnowledge : Op.AddTitle); var packet = new Packet(op, creature.EntityId); packet.PutUShort(titleId); packet.PutInt(0); creature.Client.Send(packet); }
/// <summary> /// Adds title, returns true if title was added or state /// was changed. /// </summary> /// <param name="titleId"></param> /// <param name="state"></param> /// <returns></returns> public bool Add(ushort titleId, TitleState state) { lock (_list) { if (_list.ContainsKey(titleId) && _list[titleId] == state) return false; _list[titleId] = state; } return true; }
void fadeIn() { var a = _image.color.a; a -= 1f / 60f; _image.color = new Color(_image.color.r, _image.color.g, _image.color.b, a); if (_image.color.a < 0) { state = TitleState.Waiting; } }
// Update is called once per frame void Update() { if (state == TitleState.INITIAL) { titletext.GetComponent <Fade>().show(false); gameObject.GetComponent <Fade>().show(false); instructionstext.GetComponent <Fade>().show(false); waitingtext.GetComponent <Fade>().show(false); state = TitleState.SETUP; } else if (state == TitleState.STARTTITLE) { state = TitleState.SCREENIN; gameObject.GetComponent <Fade>().fadeIn(); titletext.GetComponent <Fade>().fadeIn(); } else if (state == TitleState.SCREENIN && gameObject.GetComponent <Fade>().state == Fade.FadeState.IN) { instructionstext.GetComponent <TextMesh>().text = instructions[instructionindex]; instructionstext.GetComponent <Fade>().fadeIn(); timingcoroutine = timing(); StartCoroutine(timingcoroutine); state = TitleState.INSTRUCTIONSIN; } else if (state == TitleState.INSTRUCTIONSIN && instructionstext.GetComponent <Fade>().state == Fade.FadeState.IN) { // wait state = TitleState.INSTRUCTIONS; } else if (state == TitleState.INSTRUCTIONSOUTTRIGGER) { instructionstext.GetComponent <Fade>().fadeOut(); state = TitleState.INSTRUCTIONSOUT; } else if (state == TitleState.INSTRUCTIONSOUT && instructionstext.GetComponent <Fade>().state == Fade.FadeState.OUT) { instructionstext.GetComponent <TextMesh>().text = instructions[instructionindex]; instructionstext.GetComponent <Fade>().fadeIn(); state = TitleState.INSTRUCTIONSIN; } else if (state == TitleState.WAITTRIGGERED) { instructionstext.GetComponent <Fade>().fadeOut(); state = TitleState.WAITOUT; } else if (state == TitleState.WAITOUT && instructionstext.GetComponent <Fade>().state == Fade.FadeState.OUT) { state = TitleState.WAITIN; waitingtext.transform.Translate(new Vector3(0, 0.01f, 0)); waitingtext.GetComponent <Fade>().fadeIn(); } }
/// <summary> /// Adds title, returns true if title was added or state /// was changed. /// </summary> /// <param name="titleId"></param> /// <param name="state"></param> /// <returns></returns> public bool Add(ushort titleId, TitleState state) { lock (_list) { if (_list.ContainsKey(titleId) && _list[titleId] == state) { return(false); } _list[titleId] = state; } return(true); }
void WaitForShout() { if (state != TitleState.DisplayingStory) { return; } TitleEventManager.Instance.WaitForShout(); state = TitleState.WaitingForShout; shout.SetActive(true); story.SetActive(false); InputVoice.Instance.OnUpdateVoiceInput += OnUpdateVoiceInput; }
//Utility void ChangeCanvas(TitleState state, bool active) { float alpha = 0; if (active) { alpha = 1; } switch (state) { case TitleState.Home: break; case TitleState.Play: if (ovSearchingCo == null) { navPlayCanvas.alpha = navPlayQueueCanvas.alpha = alpha; navPlayCanvas.blocksRaycasts = navPlayQueueCanvas.blocksRaycasts = navPlayCanvas.interactable = navPlayQueueCanvas.interactable = active; } break; case TitleState.Knowledge: navKnowledgeCanvas.alpha = alpha; navKnowledgeCanvas.blocksRaycasts = navKnowledgeCanvas.interactable = active; break; case TitleState.Options: navOptionsCanvas.alpha = alpha; navOptionsCanvas.blocksRaycasts = navOptionsCanvas.interactable = active; break; case TitleState.Community: navCommunityCanvas.alpha = alpha; navCommunityCanvas.blocksRaycasts = navCommunityCanvas.interactable = active; break; } //Hide Lower if (state != TitleState.Home) { ovLower.alpha = 0; } else { ovLower.alpha = 1; } }
// Use this for initialization void Start() { m_titlestate = TitleState.Start; m_girl = GameObject.Find("girl").GetComponent <TitleGirl>(); m_ribbon = GameObject.Find("ribbon_circle").GetComponent <TitleRibbon>(); m_titlelogo = GameObject.Find("TitleLogo").GetComponent <TitleLogo>(); m_titleui = GameObject.Find("TitleUI").GetComponent <TitleUI>(); // m_invisibleribbon = GameObject.Find("ribbon2/obj1").GetComponent<InvisibleRibbon>(); m_fadeCanvas.gameObject.SetActive(true); bgm000_startFlag = false; se001_startFlag = false; se017_startFlag = false; //QualitySettings.vSyncCount = 0; //Application.targetFrameRate = 60; }
public TitleSlotInfo(int titleID, TitleState status, long timestamp, string questID, ICollection <KeyValuePair <int, int> > goalProgress, DateTime?expireDateTime) { this.TitleID = titleID; this.Status = status; this.TimeStamp = timestamp; this.QuestID = questID; this.GoalProgress = goalProgress; if (expireDateTime == null) { this.IsExpireable = false; this.ExpireDateTime = -1L; return; } this.IsExpireable = true; this.ExpireDateTime = expireDateTime.Value.Ticks; }
public override void OnEnter(Uzu.PanelEnterContext context) { Main.GameCamera.gameObject.SetActive(false); Main.Instance._tvCamera.gameObject.SetActive(false); Main.Instance._titleCamera.transform.parent.gameObject.SetActive(true); gameObject.SetActive(true); _intro_bgm_handle = Main.AudioController.PlayBgm(AudioClipIds.BGM_MENU_INTRO,false); sprite_set_alpha(_spotco_logo,0); sprite_set_alpha(_mnm_base,1); sprite_set_alpha(_mnm_logo,1); sprite_set_y(_mnm_logo,-280); sprite_set_alpha(_mnm_base,1); sprite_set_alpha(_cover,1); sprite_set_alpha(_click_anywhere_to_start,0); sprite_set_alpha(_credits,0); _camera_fade.set_alpha(1); _camera_fade.set_target_alpha(1); _current_state = TitleState.SpotcoLogoIn; _anim_t = 0; }
void Awake() { state_ = TitleState.Set; }
//Constructor public TitleScreen(Rectangle viewPort) { this.z_currentState = TitleState.Start; this.z_isLoaded = false; this.z_viewPort = viewPort; }
//Update Method public void update(KeyboardState currentKeyboardState, KeyboardState previousKeyboardState) { //Don't update anything if the titleScreen is not loaded if (!this.z_isLoaded) return; switch (this.z_currentState) { case TitleState.Start: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Down) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Options; this.z_arrow.setPosition(new Vector2((float)((this.z_viewPort.Width / 2) - 170), (float)(this.z_viewPort.Height / 2)+125)); } break; } case TitleState.Options: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Down) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Exit; this.z_arrow.setPosition(new Vector2((float)((this.z_viewPort.Width / 2) - 170), (float)(this.z_viewPort.Height / 2)+190)); } else if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Up) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Start; this.z_arrow.setPosition(new Vector2((float)((this.z_viewPort.Width / 2) - 170), (float)(this.z_viewPort.Height / 2)+50)); } break; } case TitleState.Exit: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Up) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Options; this.z_arrow.setPosition(new Vector2((float)((this.z_viewPort.Width / 2) - 170), (float)(this.z_viewPort.Height / 2)+125)); } break; } } }
public void setState(TitleState newState) { this.z_currentState = newState; }
public override void Update(GameTime gameTime) { KeyboardState state = Keyboard.GetState(); Keys[] downKeys = state.GetPressedKeys(); switch (runState) { case TitleState.Options: if (this.controlLag == 0) { if (this.selection < 100) { // Not setting controls if (state.IsKeyDown(Keys.Up) || state.IsKeyDown(Keys.Down) || state.IsKeyDown(Game1.controls.Up) || state.IsKeyDown(Game1.controls.Down)) { // If you add more than two options, make sure that this is changed appropriately this.controlLag = 16; if (state.IsKeyDown(Keys.Up) || state.IsKeyDown(Game1.controls.Up)) this.selection--; if (state.IsKeyDown(Keys.Down) || state.IsKeyDown(Game1.controls.Down)) this.selection++; if (this.selection > 3) this.selection = 0; if (this.selection < 0) this.selection = 3; } else if (state.IsKeyDown(Keys.Enter) || state.IsKeyDown(Game1.controls.Shoot)) { PlaySound.Pause(); this.controlLag = 16; if (this.selection == 0) { // Return to title screen this.selection = 0; this.runState = TitleState.TitleScreen; } else if (this.selection == 1) { // Go into control-setting mode this.selection = 101; } else if (this.selection == 2) { // Change sound effects PlaySound.Enabled = !(PlaySound.Enabled); } else if (this.selection == 3) { // Enter/exit full screen this.game.ToggleFullScreen(); } } } else if (downKeys.Any()) { // Setting controls // 101 - Up // 102 - Down // 103 - Left // 104 - Right // 105 - Shoot Keys testKey = downKeys[0]; if (testKey != Keys.Enter) { switch (selection) { case 101: Game1.controls.Up = testKey; break; case 102: Game1.controls.Down = testKey; break; case 103: Game1.controls.Left = testKey; break; case 104: Game1.controls.Right = testKey; break; case 105: Game1.controls.Shoot = testKey; break; } PlaySound.Pause(); controlLag = 16; selection++; if (selection == 106) selection = 0; } } } else { this.controlLag--; } break; case TitleState.TitleScreen: if (this.controlLag == 0 && (state.IsKeyDown(Keys.Enter) || state.IsKeyDown(Game1.controls.Shoot))) { if (this.selection == 0) { PlaySound.Aspect(); this.game.Start(); } else { PlaySound.Pause(); this.selection = 0; this.runState = TitleState.Options; this.controlLag = 16; } } else if (this.controlLag == 0 && (state.IsKeyDown(Keys.Up) || state.IsKeyDown(Keys.Down) || state.IsKeyDown(Game1.controls.Up) || state.IsKeyDown(Game1.controls.Down))) { this.controlLag = 16; this.selection++; if (this.selection > 1) this.selection = 0; } if (this.controlLag > 0) this.controlLag--; break; default: if (state.IsKeyDown(Keys.Enter)) { PlaySound.Aspect(); this.game.Start(); } break; } }
public TitleScreen(Game1 game) { this.runState = TitleState.TitleScreen; this.game = game; this.font = Game1.texCollection.arcadeFont; }
void OnGUI() { EzGUI.scaleGUI(); switch(titleState){ case TitleState.START: bg.GetComponent<SpriteRenderer>().enabled = true; bg2.GetComponent<SpriteRenderer>().enabled = false; characters.SetActive(false); EzGUI.placeTxt("Blood Cell Brigade", 60, EzGUI.HALFW - 400, EzGUI.HALFH + 80); EzGUI.blinkTxt("Press Start", 45, EzGUI.HALFW - 400, EzGUI.HALFH - 10); if(Input.GetButtonDown("Start")){ titleState = TitleState.SELECT; } break; case TitleState.SELECT: bg.GetComponent<SpriteRenderer>().enabled = false; bg2.GetComponent<SpriteRenderer>().enabled = true; characters.SetActive(false); EzGUI.placeTxt("by Nick Dedenbach, Nickie Gregor, Helen Lai,", 45, EzGUI.HALFW + 350, EzGUI.HALFH + 450); EzGUI.placeTxt("Sarah Ovresat, Jon Wiedmann, and Austin Yarger", 45, EzGUI.HALFW + 350, EzGUI.HALFH + 500); EzGUI.placeTxt("'Aquatic Ambiance' composed by David Wise for Donkey Kong Country (SNES). Rights Nintendo.", 20, EzGUI.HALFW + 350, EzGUI.HALFH + 520); EzGUI.placeTxt("Blood Cell Brigade", 70, EzGUI.FULLW - 550, 110); if(EzGUI.placeBtn("Start Game", 55, EzGUI.FULLW - 550, 230)){ Application.LoadLevel("overworld"); return; } if(EzGUI.placeBtn("Instructions", 55, EzGUI.FULLW - 550, 320)){ titleState = TitleState.INSTRUCTIONS; return; } if(EzGUI.placeBtn("Quit", 55, EzGUI.FULLW - 550, 410)){ Application.Quit(); } break; case TitleState.INSTRUCTIONS: bg.GetComponent<SpriteRenderer>().enabled = false; bg2.GetComponent<SpriteRenderer>().enabled = false; characters.SetActive(true); if(EzGUI.placeBtn("Back", 50, 150, 90)){ titleState = TitleState.SELECT; } EzGUI.placeTxt("How to Play", 55, EzGUI.HALFW, 200); EzGUI.placeTxt("Goal: kill all the viruses and bacteria and get to the goal", 50, 650, EzGUI.HALFH - 200); EzGUI.placeTxt("Move: Left Click", 50, 350, EzGUI.HALFH - 100); EzGUI.placeTxt("Shoot antibodies: Right Click", 50, 490, EzGUI.HALFH); EzGUI.placeTxt("White blood cell", 48, 220, EzGUI.FULLH - 40); EzGUI.placeTxt("Antibody", 48, 570, EzGUI.FULLH - 40); EzGUI.placeTxt("T4 Bacteriophage", 48, 920, EzGUI.FULLH - 40); EzGUI.placeTxt("Hepatitis", 48, 1270, EzGUI.FULLH - 40); EzGUI.placeTxt("Cancer cell", 48, 1680, EzGUI.FULLH - 40); break; } }
/// <summary> /// Sends AddTitle(Knowledge) to creature's client, /// depending on state. /// </summary> /// <param name="creature"></param> /// <param name="titleId"></param> /// <param name="state"></param> public static void AddTitle(Creature creature, ushort titleId, TitleState state) { var op = (state == TitleState.Known ? Op.AddTitleKnowledge : Op.AddTitle); var packet = new Packet(op, creature.EntityId); packet.PutUShort(titleId); packet.PutInt(0); creature.Client.Send(packet); }
void Description() { state = TitleState.DESCRIPTION; AllFalse (); descriptiontitleLabel.enabled = true; descriptionLabel.enabled = true; titleButton.gameObject.SetActive (true); }
void Title() { state = TitleState.TITLE; AllFalse (); titleLabel.enabled = true; subtitleLabel.enabled = true; descriptionButton.gameObject.SetActive (true); mazePanel01.gameObject.SetActive (true); mazePanel02.gameObject.SetActive (true); mazePanel03.gameObject.SetActive (true); }
void OnGUI() { Time.timeScale = 1.0f; GameLevel.curLvl = -1; GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Resources.Load<Texture>("Images/bgTitle"), ScaleMode.ScaleAndCrop); switch (titleState) { case TitleState.ENTER: GUI.TextArea(new Rect(Screen.width/2 - 500, Screen.height/4 - 50, 1000, 100), "Divide & Conquer", headingStyle); GUI.TextArea(new Rect(Screen.width/2 - 500, Screen.height/4 + 25, 1000, 100), "A game by Nicholas Dedenbach,\nGarrett Dewald, Isaiah Hines, and Jon Wiedmann", subheadingStyle); GUI.TextArea(new Rect(Screen.width/2 - 200, Screen.height/2, 400, 100), "Press Start (Enter)", blinkFadeStyle); if(Input.GetKeyUp(KeyCode.Return) || Input.GetButtonUp("Start")){ titleState = TitleState.SELECT; return; } break; case TitleState.SELECT: GUI.TextArea(new Rect(Screen.width/2 - 500, Screen.height/4 - 50, 1000, 100), "Divide & Conquer", headingStyle); string[] c = new string[3]; cta.CopyTo(c, 0); // if(ctaPointer == TitleState.ENTER){ // c[0] = ">> " + cta[0]; // } // else if(ctaPointer == TitleState.INSTRUCTIONS){ // c[1] = ">> " + cta[1]; // } // else if(ctaPointer == TitleState.SELECT){ // actually "Quit" // c[2] = ">> " + cta[2]; // } if(GUI.Button(new Rect(Screen.width/2 - 50, Screen.height/2 - 50, 100, 25), c[0], buttonStyle)) { Application.LoadLevel("main"); return; } if(GUI.Button (new Rect(Screen.width/2 - 100, Screen.height/2, 200, 25), c[1], buttonStyle)) { titleState = TitleState.INSTRUCTIONS; return; } if(GUI.Button(new Rect(Screen.width/2 - 50, Screen.height/2 + 50, 100, 25), c[2], buttonStyle)) { Application.Quit(); return; } if(Input.GetKeyDown(KeyCode.Return) || Input.GetButtonDown("Start")){ Application.LoadLevel("main"); return; } break; case TitleState.INSTRUCTIONS: if(GUI.Button(new Rect(8, 13, 70, 25), "Back", buttonStyle)){ titleState = TitleState.SELECT; return; } GUI.TextArea(new Rect(Screen.width/2 - 500, 15, 1000, 100), "Divide & Conquer", headingStyle); //Skills GUI.TextArea(new Rect(Screen.width/4 - 150, Screen.height/7, 270, 100), "Skills", subheadingStyle); GUI.TextArea(new Rect(Screen.width/4, Screen.height/7 + 82, 700, 300), "Use LB/RB (SPACEBAR) to switch forms\n\nCombined form: gun\n\n\t\t\tMovement: LEFT STICK (WASD)\n\n\t\t\tShoot: RIGHT STICK (ARROW KEYS)\n\nSplit form: powerchain\n\n\t\t\tMovement: BOTH STICKS (WASD + ARROW KEYS)", textStyle); //Enemies GUI.TextArea(new Rect(Screen.width/4 - 150, 4*Screen.height/8, 290, 100), "Enemies", subheadingStyle); GUI.TextArea(new Rect(Screen.width/4, 4*Screen.height/8 + 82, 1000, 100), "Regular enemy: shoot\n\nLarge enemy: split with powerchain, then shoot", textStyle); //Powerups GUI.TextArea(new Rect(Screen.width/4 - 150, 2*Screen.height/3, 300, 100), "Powerups", subheadingStyle); GUI.TextArea(new Rect(Screen.width/4, 2*Screen.height/3 + 82, 1000, 100), "Speed Powerup\n\nFirechain Powerup: deadly powerchain\n\nShield Powerup: force field\n\nSplitfire powerup: split gunfire\t", textStyle); break; default: break; } }
//Update Method public void update(KeyboardState currentKeyboardState, KeyboardState previousKeyboardState) { switch (this.z_currentState) { case TitleState.Start: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Down) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Options; this.z_arrow.setPosition(new Vector2(170, 425)); } break; } case TitleState.Options: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Down) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Exit; this.z_arrow.setPosition(new Vector2(170, 490)); } else if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Up) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Start; this.z_arrow.setPosition(new Vector2(170, 350)); } break; } case TitleState.Exit: { if (previousKeyboardState.IsKeyUp(Keys.Down) && currentKeyboardState.IsKeyDown(Keys.Up) && previousKeyboardState.IsKeyUp(Keys.Up)) { this.z_currentState = TitleState.Options; this.z_arrow.setPosition(new Vector2(170, 425)); } break; } } }
void Update() { if (_intro_bgm_handle._handle_audio_source != null && !_intro_bgm_handle._handle_audio_source.isPlaying) { _intro_bgm_handle._handle_audio_source = null; Main.AudioController.PlayBgm(AudioClipIds.BGM_MENU_LOOP); } switch (_current_state) { case TitleState.SpotcoLogoIn:{ _anim_t += 0.015f; sprite_set_alpha(_spotco_logo,_anim_t); if (_anim_t >= 1.0f) { _current_state = TitleState.SpotcoLogoOut; } } break; case TitleState.SpotcoLogoOut:{ _anim_t -= 0.015f; sprite_set_alpha(_spotco_logo,_anim_t); if (_anim_t <= 0.0f) { _current_state = TitleState.MNMLogoIn; _anim_t = 0; Main.AudioController.PlayEffect("sfx_pickup"); } } break; case TitleState.MNMLogoIn:{ _anim_t += 0.025f; sprite_set_y(_mnm_logo, Util.y_for_point_of_2pt_line( new Vector2(0,-280), new Vector2(1,300), Util.bezier_val_for_t( new Vector2(0,0), new Vector2(0.5f,0), new Vector2(0.5f,1), new Vector2(1,1), _anim_t ).y)); if (_anim_t >= 1) { _current_state = TitleState.FadeToLoop; _anim_t = 1; sprite_set_alpha(_cover,0); } } break; case TitleState.FadeToLoop: { _anim_t -= 0.05f; _camera_fade.set_alpha(_anim_t); _camera_fade.set_target_alpha(_anim_t); sprite_set_alpha(_credits,1-_anim_t); if (_anim_t <= 0) { Main.AudioController.PlayEffect("crowd"); _current_state = TitleState.Loop; _anim_t = 0; } } break; case TitleState.Loop: { _anim_t += 0.05f; sprite_set_alpha(_click_anywhere_to_start,(Mathf.Sin(_anim_t)+1)/2.0f); if (Input.GetMouseButtonUp(0)) { _current_state = TitleState.FadeOutToTV; _anim_t = 0; Main.AudioController.PlayEffect("sfx_checkpoint"); } } break; case TitleState.FadeOutToTV: { _anim_t += 0.015f; _camera_fade.set_alpha(_anim_t); _camera_fade.set_target_alpha(_anim_t); sprite_set_alpha(_mnm_base,1-_anim_t); sprite_set_alpha(_mnm_logo,1-_anim_t); sprite_set_alpha(_credits,1-_anim_t); sprite_set_alpha(_click_anywhere_to_start,0); if (_anim_t >= 1) { _current_state = TitleState.GotoTV; } } break; case TitleState.GotoTV: { Main.PanelManager.ChangeCurrentPanel(PanelIds.Tv); } break; } }
void GameStart() { state = TitleState.START; if(fadeBlack.gameObject.activeSelf == false) { fadeBlack.gameObject.SetActive(true); } }