public PlayerSpaceInvaders(GameScreen i_GameScreen, string i_PlayerNickname, eSpaceShipType i_SpaceShipType) : base(i_GameScreen.Game, i_PlayerNickname) { m_LoseLifeSound = SoundFactory.CreateSound(this.Game, SoundFactory.eSoundType.LifeDie) as Sound; m_Nickname = i_PlayerNickname; m_SpaceShipType = i_SpaceShipType; m_ScoreText = SpritesFactory.CreateSprite(i_GameScreen, SpritesFactory.eSpriteType.SmallText) as Text; SpritesFactory.eSpriteType lifeType = SpritesFactory.eSpriteType.LifeBlueSpaceShip; switch (m_SpaceShipType) { case eSpaceShipType.Blue: m_SpaceShip = SpritesFactory.CreateSprite(i_GameScreen, SpritesFactory.eSpriteType.BlueSpaceShip) as SpaceShip; m_ScoreText.TintColor = Color.Blue; lifeType = SpritesFactory.eSpriteType.LifeBlueSpaceShip; break; case eSpaceShipType.Green: m_SpaceShip = SpritesFactory.CreateSprite(i_GameScreen, SpritesFactory.eSpriteType.GreenSpaceShip) as SpaceShip; m_ScoreText.TintColor = Color.Green; lifeType = SpritesFactory.eSpriteType.LifeGreenSpaceShip; break; } for (int i = 0; i < this.Lifes; i++) { Life life = SpritesFactory.CreateSprite(i_GameScreen, lifeType) as Life; life.Initialize(); this.LifesSprites.Add(life); } }
public override void Initialize() { m_Mouse = SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.Mouse) as MouseSprite; m_TitleText = SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.BigText) as Text; m_TitleText.TextString = m_MenuTitle; m_TitleText.Position = new Vector2(0, 20); TextServices.CenterTextsOnScreen(this, new List<Text>() { m_TitleText }); InitMenuItems(); base.Initialize(); }
public PauseScreen(Game i_Game) : base(i_Game) { m_MessageSprite = SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.MediumText) as Text; m_MessageSprite.Position = new Vector2(180, 230); (m_MessageSprite as Text).TextString = "Click R to continue playing"; TextServices.CenterTextsOnScreen(this, new List<Text>() { (m_MessageSprite as Text) }); this.IsModal = true; this.IsOverlayed = true; this.UseGradientBackground = true; this.BlackTintAlpha = 0.4f; }
protected override void initTexts() { base.initTexts(); Text headText = SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.BigText) as Text; headText.Position = new Vector2(250, 200); headText.TintColor = Color.Lime; headText.TextString = "Starting level " + m_CurrentLevel; TextServices.CenterTextsOnScreen(this, new List<Text>() { headText }); m_CountingText = SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.BigText) as Text; m_CountingText.Position = new Vector2(350, 300); m_CountingText.TintColor = Color.White; m_CountingText.TextString = m_CurrentCountingNum.ToString(); TextServices.CenterTextsOnScreen(this, new List<Text>() { m_CountingText }); }
public GameMenuItem(string i_ItemName, GameScreen i_GameScreen, Color i_Color, eFontSize i_FontSize = eFontSize.Big, params MethodKey[] i_Methods) : base(i_ItemName, i_Methods) { switch(i_FontSize) { case eFontSize.Medium: m_TextSpriteType = SpritesFactory.eSpriteType.MediumText; break; case eFontSize.Small: m_TextSpriteType = SpritesFactory.eSpriteType.SmallText; break; } m_Text = SpritesFactory.CreateSprite(i_GameScreen, m_TextSpriteType) as Text; m_Text.TextString = i_ItemName; m_Text.TintColor = r_OriginalColor = i_Color; m_GameScreen = i_GameScreen; m_MoveBetweenItemsSound = SoundFactory.CreateSound(this.m_GameScreen, SoundFactory.eSoundType.MenuMove); }
public MouseSprite(GameScreen i_GameScreen, string i_AssetName) : base(i_AssetName, i_GameScreen) { m_Tooltip = SpritesFactory.CreateSprite(this.GameScreen, SpritesFactory.eSpriteType.SmallText) as Text; }
public static Sprite CreateSprite(GameScreen i_GameScreen, eSpriteType i_SpriteType) { Sprite sprite = null; switch (i_SpriteType) { case eSpriteType.Bullet: sprite = new Bullet(i_GameScreen, k_BulletAsset); break; case eSpriteType.EnemyLightBlue: sprite = new Enemy(i_GameScreen, Color.LightBlue, 2, 4, k_EnemysAsset); break; case eSpriteType.EnemyPink: sprite = new Enemy(i_GameScreen, Color.Pink, 0, 2, k_EnemysAsset); break; case eSpriteType.EnemyYellow: sprite = new Enemy(i_GameScreen, Color.Yellow, 4, 6, k_EnemysAsset); break; case eSpriteType.MotherShip: sprite = new MotherShip(i_GameScreen, k_MotherSpaceShipAsset); break; case eSpriteType.SpaceBackground: sprite = new SpaceBackground(i_GameScreen, k_SpaceBGAsset); break; case eSpriteType.BlueSpaceShip: sprite = new SpaceShip(i_GameScreen, k_BlueSpaceShipAsset); break; case eSpriteType.GreenSpaceShip: sprite = new SpaceShip(i_GameScreen, k_GreenSpaceShipAsset); break; case eSpriteType.Barrier: sprite = new Barrier(i_GameScreen, k_BarrierAsset); break; case eSpriteType.SmallText: sprite = new Text(i_GameScreen, k_CalibriSmallFontAsset); break; case eSpriteType.MediumText: sprite = new Text(i_GameScreen, k_CalibriMediumFontAsset); break; case eSpriteType.BigText: sprite = new Text(i_GameScreen, k_CalibriBigFontAsset); break; case eSpriteType.LifeBlueSpaceShip: sprite = new Life(i_GameScreen, k_BlueSpaceShipAsset); break; case eSpriteType.LifeGreenSpaceShip: sprite = new Life(i_GameScreen, k_GreenSpaceShipAsset); break; case eSpriteType.Mouse: sprite = new MouseSprite(i_GameScreen, k_MouseAsset); break; } sprite.Initialize(); i_GameScreen.Add(sprite); return sprite; }