/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Create game systems InputSystem = new InputSystem(this); NetworkSystem = new NetworkSystem(this); RenderingSystem = new RenderingSystem(this); MovementSystem = new MovementSystem(this); WeaponSystem = new WeaponSystem(this); EnemyAISystem = new EnemyAISystem(this); NpcAISystem = new NpcAISystem(this); GarbagemanSystem = new GarbagemanSystem(this); CollisionSystem = new Systems.CollisionSystem(this); RoomChangingSystem = new RoomChangingSystem(this); QuestLogSystem = new QuestLogSystem(this); SpriteAnimationSystem = new SpriteAnimationSystem(this); SkillSystem = new SkillSystem(this); TextSystem = new TextSystem(this); EngineeringOffenseSystem = new EngineeringOffenseSystem(this); HUDSystem = new HUDSystem(this); InputHelper.Load(); HUDSystem.LoadContent(); // Testing code. LevelManager.LoadContent(); LevelManager.LoadLevel("D01F01R01"); //Song bg = Content.Load<Song>("Audio/Main_Loop"); //MediaPlayer.Stop(); //MediaPlayer.IsRepeating = true; //MediaPlayer.Play(bg); //End Testing Code }
/// <summary> /// Delete pieces. /// Delete the board. /// Creates the texts of the end screen. /// </summary> /// <returns></returns> IEnumerator endGame() { StartCoroutine(deletePieces()); StartCoroutine(deleteBoard()); if (m_scoreArray[Globals.PLAYER_ONE - 1] > m_scoreArray[Globals.PLAYER_TWO - 1]) { m_winText = TextSystem.initializeText("Player 1 wins !\n\n\t Badass !", "m_winText", new Vector3(45f, 54f, 90f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 78, ColorMgt.p_cyan); } else if (m_scoreArray[Globals.PLAYER_ONE - 1] < m_scoreArray[Globals.PLAYER_TWO - 1]) { m_winText = TextSystem.initializeText("Player 2 wins !\n\n\t Badass !", "m_winText", new Vector3(45f, 54f, 90f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 78, ColorMgt.p_cyan); } else { m_winText = TextSystem.initializeText("Draw " + m_scoreArray[Globals.PLAYER_ONE - 1] + " : " + m_scoreArray[Globals.PLAYER_TWO - 1] + " !\n\n Again !", "m_winText", new Vector3(55f, 54f, 90f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 78, ColorMgt.p_cyan); } m_restartText = TextSystem.initializeText("Click to restart", "Restart Text", new Vector3(58f, 54f, 58f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 48, ColorMgt.p_cyan); m_restartText.AddComponent <TextBlinker>().blink(Globals.BLINK_TIME, Globals.BLINK_TIME, true, false, false); GameObject.Find("SideSurfaces").GetComponent <SideBoardSystem>().deleteSidePieces(); yield return(new WaitForSeconds(Globals.ENDSCREEN_TIMER)); m_endGameLaunched = true; yield return(true); }
public void CreateCard(int shapeIndex, int cardIndex) { var card = Instantiate(_cardClone); card.SetCardIndex((cardIndex + 1) * 10); card.SetBackgroundSprite(BackGroundSprite); card.SetBackCardSprite(BackCardSprite); card.SetParent(transform); ShapeSystem.GetInstance().CreateCardShapeCenter(card, shapeIndex); if (cardIndex < 13) { ShapeSystem.GetInstance().InitizlizeCardShapeSide(card, shapeIndex); TextSystem.GetInstance().AddCardText(card, NormalTextPos, NormalTextScale, 1); TextSystem.GetInstance().AddCardText(card, NormalTextPos, NormalTextScale, -1); } else { TextSystem.GetInstance().AddCardText(card, JokerTextPos, JokerTextScale, 1); TextSystem.GetInstance().AddCardText(card, JokerTextPos, JokerTextScale, -1); } card.SetScale(CardScale); card.SetSortingOrder(Cards.Count); card.gameObject.SetActive(false); Cards.Add(card); }
/// <summary> /// A popup is created, blinking once, following the active player. /// </summary> /// <returns></returns> IEnumerator playerChangePopup() { //script deactivated during movements and popups m_scriptActive = false; // wait the end of the pieces movements before displaying the popup yield return(new WaitForSeconds(Globals.PIECE_MOVE_TIME)); switch (m_activePlayer) { case Globals.PLAYER_ONE: m_playerOnePopup = TextSystem.initializeText("Player 1", "Player One Popup", new Vector3(Globals.PLAYER_TEXT_X, Globals.PLAYER_TEXT_Y, Globals.PLAYER_TEXT_Z), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 78, ColorMgt.p_paleBlue); m_playerOnePopup.AddComponent <TextBlinker>().blink(Globals.PLAYER_TEXT_APPEAR, Globals.PLAYER_TEXT_FADE, false, false, true); break; case Globals.PLAYER_TWO: m_playerTwoPopup = TextSystem.initializeText("Player 2", "Player Two Popup", new Vector3(Globals.PLAYER_TEXT_X, Globals.PLAYER_TEXT_Y, Globals.PLAYER_TEXT_Z), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 78, ColorMgt.p_paleRed); m_playerTwoPopup.AddComponent <TextBlinker>().blink(Globals.PLAYER_TEXT_APPEAR, Globals.PLAYER_TEXT_FADE, false, false, true); break; default: break; } // wait the end of the popup yield return(new WaitForSeconds(Globals.PLAYER_TEXT_TIME)); m_scriptActive = true; }
/// <summary> /// Score initialization : text and values /// </summary> void initializeScore() { for (int i = 0; i < Globals.PLAYER_NUMBER; ++i) { m_scoreArray[i] = 0; if (m_scoreTextArray[i] != null) { Destroy(m_scoreTextArray[i]); } } //TODO : remove hard-coded values m_scoreTextArray[Globals.PLAYER_ONE - 1] = TextSystem.initializeText(m_scoreArray[Globals.PLAYER_ONE - 1].ToString(), "Score1", new Vector3(48.5f, 69f, 96f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 50, ColorMgt.p_paleBlue); m_scoreTextArray[Globals.PLAYER_TWO - 1] = TextSystem.initializeText(m_scoreArray[Globals.PLAYER_TWO - 1].ToString(), "Score2", new Vector3(100f, 69f, 96f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 50, ColorMgt.p_paleRed); for (int i = 0; i < Globals.PLAYER_NUMBER; ++i) { m_scoreTextArray[i].AddComponent <TextBlinker>(); } highlightPlayerScore(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Create game systems InputSystem = new InputSystem(this); NetworkSystem = new NetworkSystem(this); RenderingSystem = new RenderingSystem(this); MovementSystem = new MovementSystem(this); WeaponSystem = new WeaponSystem(this); EnemyAISystem = new EnemyAISystem(this); NpcAISystem = new NpcAISystem(this); GarbagemanSystem = new GarbagemanSystem(this); CollisionSystem = new Systems.CollisionSystem(this); RoomChangingSystem = new RoomChangingSystem(this); QuestLogSystem = new QuestLogSystem(this); SpriteAnimationSystem = new SpriteAnimationSystem(this); SkillSystem = new SkillSystem(this); TextSystem = new TextSystem(this); // Testing code. LevelManager.LoadContent(); LevelManager.LoadLevel("D01F01R01"); //End Testing Code }
// Start is called before the first frame update void Start() { ts = GameObject.FindWithTag("Text").GetComponent <TextSystem>(); fade = GameObject.FindWithTag("Fade").GetComponent <Fade>(); scene = GetComponent <Scene>(); fade.isFadeOut = true; }
protected override void Update(GameTime gameTime) { //Console.Log(IsLoaded); if (!GameContent.IsLoaded) { //Console.Log("loading"); base.Update(gameTime); return; } //Update KeyboardController for Commands keyboard.Update(); Input.GetState(); // Game implemented using Entity-Component-System, // Systems store instances of certain types of Components TransformSystem.Update(gameTime); BehaviorScriptSystem.Update(gameTime); ColliderSystem.Update(gameTime); ColliderSystem.Check(); SpriteSystem.Update(gameTime); TextSystem.Update(gameTime); //Sound.Update(gameTime); base.Update(gameTime); }
protected override void Draw(GameTime gameTime) { if (gameTime.TotalGameTime.Seconds > _lastTime) { _lastTime = gameTime.TotalGameTime.Seconds; frame = frameCounter; frameCounter = 0; } frameCounter++; if (!GameContent.IsLoaded) { GraphicsDevice.Clear(Color.CornflowerBlue); if (GameContent.IsBaseLoaded) { var size = GameContent.Font.hudFont.MeasureString("Click on game area to start it!"); spriteBatch.Begin(); if (!GameContent.IsLoaded) { spriteBatch.DrawString(GameContent.Font.hudFont, "Zelda is loading: " + GameContent.Counter + " / " + GameContent.Max, new Vector2(20, 440 - size.Y - 10), Color.White, 0f, Vector2.Zero, .5f, SpriteEffects.None, 1f); //spriteBatch.Draw(GameContent.Texture.Pixel, new Rectangle(20, 440, (int)(760 * (GameContent.Counter / (float)GameContent.Max)), 20), Color.White); } spriteBatch.End(); } base.Draw(gameTime); return; } GraphicsDevice.Clear(Color.IndianRed); spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp); SpriteSystem.Draw(spriteBatch); // Draw all Sprite components ColliderSystem.Draw(spriteBatch); // Draw all Collider debug boxes TextSystem.Draw(spriteBatch); // Draw all Text components if (LevelManager.showFPS) { DrawShadowedString(GameContent.Font.hudFont, "FPS: " + frame, new Vector2(440f, 20f), Color.Yellow); } spriteBatch.End(); base.Draw(gameTime); }
void Start() { //Fetch the Text and RectTransform components from the GameObject text = GetComponent <Text>(); recTransform = GetComponent <RectTransform>(); textSystem = TextSystem.instance; textColor = textSystem.nameTextColour; ; wordSize = textSystem.nameTextSize; }
// Token: 0x0600006A RID: 106 RVA: 0x0000C3E0 File Offset: 0x0000A5E0 protected void ReadNullLeaderboardEntries() { int num = ObjectSystem.globalVariables[114]; TextSystem.SetupTextMenu(StageSystem.gameMenu[0], 0); for (int i = 0; i < 100; i++) { string text = string.Format("{0,4}{1,-15}", (i + 1).ToString() + ".", "---------------"); TextSystem.AddTextMenuEntry(StageSystem.gameMenu[0], text.ToCharArray()); } }
private void ResetGame() { ComponentManager.Get().ClearComponents(); renderingSystem = new RenderingSystem(); physicsSystem = new PhysicsSystem(); collisionDetectionSystem = new CollisionDetectionSystem(); inputSystem = new InputSystem(); spawnSystem = new SpawnSystem(); textSystem = new TextSystem(); CreateEntities(); }
protected override void UnloadContent() { Content.Unload(); // We need to clear all our components to reset state; If the program is reset they will be created fresh by the new Link() instance TransformSystem.Clear(); ColliderSystem.Clear(); BehaviorScriptSystem.Clear(); SpriteSystem.Clear(); TextSystem.Clear(); Scene.Clear(); }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; renderingSystem = new RenderingSystem(); physicsSystem = new PhysicsSystem(); collisionDetectionSystem = new CollisionDetectionSystem(); inputSystem = new InputSystem(); spawnSystem = new SpawnSystem(); textSystem = new TextSystem(); scoreSystem = new ScoreSystem(); }
void Start() { // TODO : remove hard-coded values m_titleObj = TextSystem.initializeText("ShockWave", "Title", new Vector3(53f, 64f, 93f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 78, ColorMgt.p_cyan); m_versionObj = TextSystem.initializeText("v0.1", "Version", new Vector3(70f, 64f, 83f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontGames, 48, ColorMgt.p_cyan); m_startObj = TextSystem.initializeText("Click to start", "Start", new Vector3(61f, 64f, 70f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 48, ColorMgt.p_cyan); // highlight the start text m_startObj.AddComponent <TextBlinker>().blink(Globals.BLINK_TIME, Globals.BLINK_TIME, true, true, false); }
// Token: 0x06000069 RID: 105 RVA: 0x0000C1B0 File Offset: 0x0000A3B0 protected void ReadLeaderboardEntries() { int num = ObjectSystem.globalVariables[114]; TextSystem.SetupTextMenu(StageSystem.gameMenu[0], 0); LeaderboardReader leaderboardReader = this.leaderboardReader; if (num == 0) { for (int i = 0; i < this.leaderboardReader.Entries.Count; i++) { LeaderboardEntry leaderboardEntry = leaderboardReader.Entries[i]; string text = string.Format("{0,4}{1,-15}{2,1}{3,8}", new object[] { (i + 1).ToString() + ".", leaderboardEntry.Gamer.Gamertag, " ", leaderboardEntry.Columns.GetValueInt32("BestScore").ToString() }); TextSystem.AddTextMenuEntry(StageSystem.gameMenu[0], text.ToCharArray()); } } else { for (int i = 0; i < this.leaderboardReader.Entries.Count; i++) { LeaderboardEntry leaderboardEntry2 = leaderboardReader.Entries[i]; int num2 = leaderboardEntry2.Columns.GetValueInt32("BestTime"); int num3 = num2 / 6000; int num4 = num2 / 100 % 60; num2 %= 100; string text = string.Format("{0,4}{1,-15}{2,2}{3,1}{4,1}{5,2}{6,1}{7,2}", new object[] { (i + 1).ToString() + ".", leaderboardEntry2.Gamer.Gamertag, " ", num3.ToString(), "'", num4.ToString(), "\"", num2.ToString() }); TextSystem.AddTextMenuEntry(StageSystem.gameMenu[0], text.ToCharArray()); } } for (int i = this.leaderboardReader.Entries.Count; i < 100; i++) { string text = string.Format("{0,4}{1,-15}", (i + 1).ToString() + ".", "---------------"); TextSystem.AddTextMenuEntry(StageSystem.gameMenu[0], text.ToCharArray()); } }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.IsFullScreen = true; graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 480; graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; renderingSystem = new RenderingSystem(); physicsSystem = new PhysicsSystem(); collisionDetectionSystem = new CollisionDetectionSystem(); inputSystem = new InputSystem(); spawnSystem = new SpawnSystem(); textSystem = new TextSystem(); scoreSystem = new ScoreSystem(); }
public Text(string givenString, bool givenAnimate) { TextSystem.Register(this); font = GameContent.Font.hudFont; StringToWrite = givenString; animate = givenAnimate; if (!animate) { CurrentString = givenString; } else { Sound.PlaySound(Sound.SoundEffects.Text, true); } textBox = new Rectangle(0, 0, Game1.viewport.Bounds.Width, Game1.viewport.Bounds.Height); }
/// <summary> /// Chooses randomly the first player /// Creates the first popup following the player chosen /// </summary> void playerStart() { m_activePlayer = (byte)UnityEngine.Random.Range(Globals.PLAYER_ONE, Globals.PLAYER_TWO + 1); GameObject playerStartPopup; switch (m_activePlayer) { case Globals.PLAYER_ONE: playerStartPopup = TextSystem.initializeText("Player 1 starts", "Player One Popup", new Vector3(51f, 65f, 86f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 78, ColorMgt.p_paleBlue); playerStartPopup.AddComponent <TextBlinker>().blink(Globals.PLAYER_TEXT_APPEAR, Globals.PLAYER_TEXT_FADE, false, false, true); break; case Globals.PLAYER_TWO: playerStartPopup = TextSystem.initializeText("Player 2 starts", "Player Two Popup", new Vector3(51f, 65f, 86f), Quaternion.Euler(new Vector3(Globals.PLAYER_TEXT_RX, Globals.PLAYER_TEXT_RY, Globals.PLAYER_TEXT_RZ)), Globals.p_fontThirsty, 78, ColorMgt.p_paleRed); playerStartPopup.AddComponent <TextBlinker>().blink(Globals.PLAYER_TEXT_APPEAR, Globals.PLAYER_TEXT_FADE, false, false, true); break; default: break; } }
void Awake() { instance = this; }
// Start is called before the first frame update void Start() { textSystem = TextSystem.instance; }