diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2017-12-29 17:27:49 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2017-12-29 17:27:49 +0100 |
| commit | da38e93e55b6ff46a53dcd9d2be393149089d329 (patch) | |
| tree | c19fdb964ee6f8dd8dd3102b22de541828850983 /Penguloon | |
| parent | 5373e919a0d9e389fc2076963f610d044c21ccb5 (diff) | |
obejct info, new level selector, credits haHA
Diffstat (limited to 'Penguloon')
34 files changed, 595 insertions, 56 deletions
diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb index 6deb51f..72fd65c 100644 --- a/Penguloon/Content/Content.mgcb +++ b/Penguloon/Content/Content.mgcb @@ -613,3 +613,33 @@ /processorParam:TextureFormat=Color /build:SplashArt/2.png +#begin Sounds/click2.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sounds/click2.wav + +#begin Objects/healthRegenerator.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Objects/healthRegenerator.png + +#begin UI/textPanel.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:UI/textPanel.png + diff --git a/Penguloon/Content/Objects/healthRegenerator.png b/Penguloon/Content/Objects/healthRegenerator.png Binary files differnew file mode 100644 index 0000000..55b62cb --- /dev/null +++ b/Penguloon/Content/Objects/healthRegenerator.png diff --git a/Penguloon/Content/Sounds/click2.wav b/Penguloon/Content/Sounds/click2.wav Binary files differnew file mode 100644 index 0000000..5910d1f --- /dev/null +++ b/Penguloon/Content/Sounds/click2.wav diff --git a/Penguloon/Content/UI/border-horizontal.png b/Penguloon/Content/UI/border-horizontal.png Binary files differindex 1a36c50..a4bcf08 100644 --- a/Penguloon/Content/UI/border-horizontal.png +++ b/Penguloon/Content/UI/border-horizontal.png diff --git a/Penguloon/Content/UI/border.png b/Penguloon/Content/UI/border.png Binary files differindex 535c39b..24eda95 100644 --- a/Penguloon/Content/UI/border.png +++ b/Penguloon/Content/UI/border.png diff --git a/Penguloon/Content/UI/btnDisabled.png b/Penguloon/Content/UI/btnDisabled.png Binary files differindex 1a0bbfd..2eafa8e 100644 --- a/Penguloon/Content/UI/btnDisabled.png +++ b/Penguloon/Content/UI/btnDisabled.png diff --git a/Penguloon/Content/UI/btnIdle.png b/Penguloon/Content/UI/btnIdle.png Binary files differindex f536b99..fd47844 100644 --- a/Penguloon/Content/UI/btnIdle.png +++ b/Penguloon/Content/UI/btnIdle.png diff --git a/Penguloon/Content/UI/btnPressed.png b/Penguloon/Content/UI/btnPressed.png Binary files differindex b7dfe7d..9576d29 100644 --- a/Penguloon/Content/UI/btnPressed.png +++ b/Penguloon/Content/UI/btnPressed.png diff --git a/Penguloon/Content/UI/lightred.png b/Penguloon/Content/UI/lightred.png Binary files differindex c0d548d..ab44dd8 100644 --- a/Penguloon/Content/UI/lightred.png +++ b/Penguloon/Content/UI/lightred.png diff --git a/Penguloon/Content/UI/objectSelectionBackground.png b/Penguloon/Content/UI/objectSelectionBackground.png Binary files differindex 3476eab..4745e9f 100644 --- a/Penguloon/Content/UI/objectSelectionBackground.png +++ b/Penguloon/Content/UI/objectSelectionBackground.png diff --git a/Penguloon/Content/UI/textPanel.png b/Penguloon/Content/UI/textPanel.png Binary files differnew file mode 100644 index 0000000..4bcf049 --- /dev/null +++ b/Penguloon/Content/UI/textPanel.png diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs index 58fafda..ad94740 100644 --- a/Penguloon/ContentPathManager.cs +++ b/Penguloon/ContentPathManager.cs @@ -22,6 +22,7 @@ namespace Penguloon "Objects/cannon", "Objects/penguin1", "Objects/penguin2", + "Objects/healthRegenerator", "Tiles/ice", "Tiles/waterCornerLeftDown", @@ -46,6 +47,7 @@ namespace Penguloon "UI/msgBoxBackground", "UI/unselectableTile", "UI/lock", + "UI/textPanel", "SplashArt/locked", "SplashArt/1", @@ -76,6 +78,7 @@ namespace Penguloon public static List<string> SoundPaths { get; set; } = new List<string>() { "Sounds/click", + "Sounds/click2", "Sounds/pop", }; diff --git a/Penguloon/Controls/Button.cs b/Penguloon/Controls/Button.cs index 757b87d..542fb7f 100644 --- a/Penguloon/Controls/Button.cs +++ b/Penguloon/Controls/Button.cs @@ -12,7 +12,7 @@ namespace Penguloon.Controls this.BackgroundDisabled = ContentManager.GetTexture("UI/btnDisabled"); this.Text = text; - this.ForeColor = Color.Gray; + this.ForeColor = Color.White; this.BorderColor = Color.Gray; this.BorderWidth = 0; this.Font = ContentManager.GetFont(StaticUIValues.MenuFont); diff --git a/Penguloon/Controls/ControlBase.cs b/Penguloon/Controls/ControlBase.cs index b6b7a57..bbd3a14 100644 --- a/Penguloon/Controls/ControlBase.cs +++ b/Penguloon/Controls/ControlBase.cs @@ -25,6 +25,7 @@ namespace Penguloon.Controls public Texture2D BackgroundDisabled { get; set; } public event EventHandler OnMissClick; + public event EventHandler<ClickArgs> OnFingerDown; public event EventHandler<ClickArgs> OnClick; public event EventHandler<MoveArgs> OnMove; @@ -92,7 +93,7 @@ namespace Penguloon.Controls if (touchRec.Intersects(controlRec)) { - if (touchLocations[i].State == TouchLocationState.Released) + if (touchLocations[i].State == TouchLocationState.Released && this.ControlState == ControlState.Pressed) { this.ControlState = ControlState.Idle; OnClick?.Invoke(this, new ClickArgs(touchLocations[i].Position)); @@ -101,10 +102,12 @@ namespace Penguloon.Controls if (touchLocations[i].State == TouchLocationState.Pressed) { this.ControlState = ControlState.Pressed; + OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position)); } if (touchLocations[i].State == TouchLocationState.Moved) { + OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position)); touchLocations[i].TryGetPreviousLocation(out TouchLocation touch); OnMove?.Invoke(this, new MoveArgs(touchLocations[i].Position, touch.Position)); } diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs index c04aef3..0309b68 100644 --- a/Penguloon/Controls/LevelSelector.cs +++ b/Penguloon/Controls/LevelSelector.cs @@ -17,9 +17,11 @@ namespace Penguloon.Controls public List<LevelBase> Levels { get; set; } = new List<LevelBase>(); + public Rectangle Panel0 { get; set; } public Rectangle Panel1 { get; set; } public Rectangle Panel2 { get; set; } public Rectangle Panel3 { get; set; } + public Rectangle Panel4 { get; set; } public LevelSelector(SceneBase parentScene, Vector2 position, Vector2 size) : base(parentScene, position, size) { @@ -31,16 +33,21 @@ namespace Penguloon.Controls PanelWidth = ((int)((StaticUIValues.ScreenViewport.X - ((MaxPanels + 1) * PanelMarginX)) / MaxPanels)); + int panel0posX = (PanelMarginX + (PanelMarginX * 0) + (PanelWidth * -1)) + 40; int panel1posX = (PanelMarginX + (PanelMarginX * 0) + (PanelWidth * 0)) + 20; int panel2posX = (PanelMarginX + (PanelMarginX * 1) + (PanelWidth * 1)); int panel3posX = (PanelMarginX + (PanelMarginX * 2) + (PanelWidth * 2)) - 20; + int panel4posX = (PanelMarginX + (PanelMarginX * 3) + (PanelWidth * 3)) - 80; int sidePanelMarginY = 25; int centerPanelWidth = (int)(PanelWidth * 1.2); + int outterPanelHeight = (int)((size.Y - sidePanelMarginY) * 0.8); + Panel0 = new Rectangle(panel0posX, (int)position.Y + (sidePanelMarginY / 2) + ((((int)size.Y - sidePanelMarginY) - outterPanelHeight) / 2), (int)(PanelWidth), outterPanelHeight); Panel1 = new Rectangle(panel1posX, (int)position.Y + (sidePanelMarginY / 2), (int)(PanelWidth * 1), (int)size.Y - sidePanelMarginY); Panel2 = new Rectangle(panel2posX - ((centerPanelWidth - PanelWidth) / 2), (int)position.Y, centerPanelWidth, (int)size.Y); Panel3 = new Rectangle(panel3posX, (int)position.Y + (sidePanelMarginY / 2), (int)(PanelWidth * 1), (int)size.Y - sidePanelMarginY); + Panel4 = new Rectangle(panel4posX, (int)position.Y + (sidePanelMarginY / 2) + ((((int)size.Y - sidePanelMarginY) - outterPanelHeight) / 2), (int)(PanelWidth), outterPanelHeight); this.OnClick += LevelSelector_OnClick; @@ -51,21 +58,46 @@ namespace Penguloon.Controls { Rectangle fingerRec = new Rectangle(e.ClickPosition.ToPoint(), new Point(1, 1)); + if (Panel2.Intersects(fingerRec) && Levels[selectedMap].MinimumLevel <= UserdataManager.Level) + { + SoundManager.PlayClickSound(); + SceneManager.GameScene = new GameScene(ParentScene.Main, Levels[selectedMap]); + SceneManager.SelectedScene = SelectedScene.Ingame; + + SoundManager.PlayClickSound2(); + return; + } + if (Panel1.Intersects(fingerRec) && selectedMap > 0) { selectedMap--; + + SoundManager.PlayClickSound2(); + return; } - if (Panel2.Intersects(fingerRec) && Levels[selectedMap].MinimumLevel <= UserdataManager.Level) + if (Panel0.Intersects(fingerRec) && selectedMap > 1) { - SoundManager.PlayClickSound(); - SceneManager.GameScene = new GameScene(ParentScene.Main, Levels[selectedMap]); - SceneManager.SelectedScene = SelectedScene.Ingame; + selectedMap -= 2; + + SoundManager.PlayClickSound2(); + return; } if (Panel3.Intersects(fingerRec) && selectedMap < Levels.Count - 1) { selectedMap++; + + SoundManager.PlayClickSound2(); + return; + } + + if (Panel4.Intersects(fingerRec) && selectedMap < Levels.Count - 2) + { + selectedMap += 2; + + SoundManager.PlayClickSound2(); + return; } } @@ -85,6 +117,23 @@ namespace Penguloon.Controls private void DrawPanels() { + if (selectedMap - 2 >= 0) + { + ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap - 2].SplashArt, + destinationRectangle: Panel0); + + if (Levels[selectedMap - 2].MinimumLevel > UserdataManager.Level) + { + ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"), + destinationRectangle: Panel0); + + ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"), + destinationRectangle: new Rectangle(Panel0.X + 25, Panel0.Y + 25, 100, 100)); + + //DrawLevel(new Vector2(Panel0.X + 25, Panel0.Y + Panel0.Height - 20), Levels[selectedMap - 2].MinimumLevel); + } + } + if (selectedMap - 1 >= 0) { ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap - 1].SplashArt, @@ -97,9 +146,24 @@ namespace Penguloon.Controls ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"), destinationRectangle: new Rectangle(Panel1.X + 25, Panel1.Y + 25, 100, 100)); + } + DrawLevel(new Vector2(Panel1.X + 25, Panel1.Y + Panel1.Height - 10), Levels[selectedMap - 1].MinimumLevel); + } + + if (selectedMap + 2 < Levels.Count) + { + ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap + 2].SplashArt, + destinationRectangle: Panel4); + + if (Levels[selectedMap + 2].MinimumLevel > UserdataManager.Level) + { + ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("SplashArt/locked"), + destinationRectangle: Panel4); - DrawLevel(new Vector2(Panel1.X + 25, Panel1.Y + Panel1.Height - 10), Levels[selectedMap - 1].MinimumLevel); + ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"), + destinationRectangle: new Rectangle(Panel4.X + 25, Panel4.Y + 25, 100, 100)); } + DrawLevel(new Vector2(Panel4.X + 25, Panel4.Y + Panel4.Height - 10), Levels[selectedMap + 2].MinimumLevel); } if (selectedMap + 1 < Levels.Count) @@ -114,9 +178,8 @@ namespace Penguloon.Controls ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"), destinationRectangle: new Rectangle(Panel3.X + 25, Panel3.Y + 25, 100, 100)); - - DrawLevel(new Vector2(Panel3.X + 25, Panel3.Y + Panel3.Height - 10), Levels[selectedMap + 1].MinimumLevel); } + DrawLevel(new Vector2(Panel3.X + 25, Panel3.Y + Panel3.Height - 10), Levels[selectedMap + 1].MinimumLevel); } ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap].SplashArt, @@ -129,9 +192,9 @@ namespace Penguloon.Controls ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/lock"), destinationRectangle: new Rectangle(Panel2.X + 25, Panel2.Y + 25, 100, 100)); - - DrawLevel(new Vector2(Panel2.X + 25, Panel2.Y + Panel2.Height - 10), Levels[selectedMap].MinimumLevel); } + + DrawLevel(new Vector2(Panel2.X + 25, Panel2.Y + Panel2.Height - 10), Levels[selectedMap].MinimumLevel); } private void DrawLevel(Vector2 position, int minLevel) @@ -146,7 +209,7 @@ namespace Penguloon.Controls ParentScene.Main.Resources.GetString(Resource.String.StatsLevel) + " ", new Vector2((int)position.X, position.Y), new Vector2(0, 0), - TextAllignment.LeftBottom, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + TextAllignment.LeftBottom, Color.FromNonPremultiplied(111, 138, 183, 255), Color.Black, 2); } } }
\ No newline at end of file diff --git a/Penguloon/Controls/ObjectSelector.cs b/Penguloon/Controls/ObjectSelector.cs index a155601..277107b 100644 --- a/Penguloon/Controls/ObjectSelector.cs +++ b/Penguloon/Controls/ObjectSelector.cs @@ -5,6 +5,7 @@ using Penguloon.Objects; using Penguloon.Scenes; using System.Collections.Generic; using System; +using Microsoft.Xna.Framework.Graphics; namespace Penguloon.Controls { @@ -24,6 +25,9 @@ namespace Penguloon.Controls public List<Tuple<ObjectBase, int>> Objects { get; set; } = new List<Tuple<ObjectBase, int>>(); + public bool DrawInfoPanel { get; set; } = false; + public int TouchedObjectIndex { get; set; } + public ObjectSelector(Map map, SceneBase parentScene, Vector2 position, Vector2 size) : base(parentScene, position, size) { this.Map = map; @@ -32,12 +36,15 @@ namespace Penguloon.Controls this.BackgroundDisabled = ContentManager.GetTexture("UI/objectSelectionBackground"); this.OnClick += ObjectSelector_OnClick; + this.OnFingerDown += ObjectSelector_OnFingerDown; LoadObjects(); } - private void ObjectSelector_OnClick(object sender, ClickArgs e) + private void ObjectSelector_OnFingerDown(object sender, ClickArgs e) { + DrawInfoPanel = true; + int rows = 4; if (Objects.Count > 8) @@ -55,8 +62,39 @@ namespace Penguloon.Controls for (int i = 0; i < Objects.Count; i++) { - if (Objects[i].Item2 > Map.Level.Money) continue; + int posX = ((i + 1) % 2 != 0) ? oddX : evenX; + int posY = (i / 2) * height; + + Rectangle rec = new Rectangle(posX, (int)Position.Y + posY, width, height); + + if (fingerRec.Intersects(rec)) + { + TouchedObjectIndex = i; + + return; + } + } + } + + private void ObjectSelector_OnClick(object sender, ClickArgs e) + { + int rows = 4; + + if (Objects.Count > 8) + { + rows = (int)Math.Ceiling((double)Objects.Count / 2); + } + + int width = (int)Size.X / 2; + int height = (int)Size.Y / rows; + + int oddX = (int)Position.X; + int evenX = (int)Position.X + width; + Rectangle fingerRec = new Rectangle((int)e.ClickPosition.X, (int)e.ClickPosition.Y, 1, 1); + + for (int i = 0; i < Objects.Count; i++) + { int posX = ((i + 1) % 2 != 0) ? oddX : evenX; int posY = (i / 2) * height; @@ -64,6 +102,10 @@ namespace Penguloon.Controls if (fingerRec.Intersects(rec)) { + TouchedObjectIndex = i; + + if (Objects[i].Item2 > Map.Level.Money) continue; + if (SelectedObjectIndex != i) { SelectedObjectIndex = i; @@ -84,10 +126,13 @@ namespace Penguloon.Controls Objects.Add(new Tuple<ObjectBase,int>(new PenguinObject(Map), 250)); Objects.Add(new Tuple<ObjectBase, int>(new GoldPenguinObject(Map), 360)); Objects.Add(new Tuple<ObjectBase, int>(new CannonObject(Map), 650)); + Objects.Add(new Tuple<ObjectBase, int>(new HealthGeneratorObject(Map), 150)); } public override void Update(float deltaTime, TouchLocation[] touchLocations) { + DrawInfoPanel = false; + base.Update(deltaTime, touchLocations); } @@ -121,10 +166,11 @@ namespace Penguloon.Controls destinationRectangle: new Rectangle(posX, (int)Position.Y + posY, width, height)); } - int widthToDraw = height - (padding * 2); + int widthToDraw = (height / Objects[i].Item1.TileSpanY) - (padding * 2); + int heightToDraw = (height / Objects[i].Item1.TileSpanX) - (padding * (3 - Objects[i].Item1.TileSpanX)); ParentScene.Main.SpriteBatch.Draw(Objects[i].Item1.Texture, - destinationRectangle: new Rectangle(posX + (width - widthToDraw) / 2, (int)Position.Y + posY + padding, widthToDraw, height - (padding * 2))); + destinationRectangle: new Rectangle(posX + (width - widthToDraw) / 2, (int)Position.Y + posY + (height / 2) - (heightToDraw / 2), widthToDraw, heightToDraw)); ParentScene.DrawText(ContentManager.GetFont("Fonts/GWENT/36"), Objects[i].Item2.ToString(), new Vector2(posX, (int)Position.Y + posY), new Vector2(width, height), TextAllignment.CenterBottom, Color.White, Color.Black, 2); @@ -140,6 +186,38 @@ namespace Penguloon.Controls ParentScene.Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/objectSelectionBorder"), destinationRectangle: new Rectangle(oddX, (int)Position.Y + (x * height), (int)Size.X, 4)); } + + if(DrawInfoPanel) + DrawSelectedInfoPanel(); + } + + private void DrawSelectedInfoPanel() + { + Texture2D panel = ContentManager.GetTexture("UI/textPanel"); + + int padding = 15; + Vector2 panelPos = new Vector2(padding, (int)StaticUIValues.ScreenViewport.Y - (int)StaticUIValues.IngameInfoPanelSize.Y + padding); + + string[] Lines; + Lines = new string[Objects[TouchedObjectIndex].Item1.infoText.Split(new string[] { "\n" }, StringSplitOptions.None).Length]; + + Lines = Objects[TouchedObjectIndex].Item1.infoText.Split(new string[] { "\n" }, StringSplitOptions.None); + + if (panel != null) + { + ParentScene.Main.SpriteBatch.Draw(panel, + destinationRectangle: new Rectangle(0, (int)StaticUIValues.ScreenViewport.Y - (int)StaticUIValues.IngameInfoPanelSize.Y, + (int)StaticUIValues.IngameInfoPanelSize.X, (int)StaticUIValues.IngameInfoPanelSize.Y)); + } + + int lineHeight = (int)ContentManager.GetFont(StaticUIValues.IngameFont).MeasureString("zulul").Y; + + for (int i = 0; i < Lines.Length; i++) + { + ParentScene.DrawText(ContentManager.GetFont(StaticUIValues.IngameFont), Lines[i].Trim(), + new Vector2(panelPos.X, panelPos.Y + (i * lineHeight)), new Vector2(), TextAllignment.LeftTop, + Color.White, Color.Black, 2); + } } } }
\ No newline at end of file diff --git a/Penguloon/Enums.cs b/Penguloon/Enums.cs index c47de61..31d4943 100644 --- a/Penguloon/Enums.cs +++ b/Penguloon/Enums.cs @@ -21,7 +21,8 @@ namespace Penguloon Ingame, Loading, LevelSelection, - Stats + Stats, + Credits } public enum ControlState diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs index 351cdcf..2b003cf 100644 --- a/Penguloon/Levels/LevelBase.cs +++ b/Penguloon/Levels/LevelBase.cs @@ -80,8 +80,34 @@ namespace Penguloon.Levels // check if there isnt an object already for (int x = 0; x < Map.Objects.Count; x++) { - if (Map.Objects[x].Position == new Vector2(posToSpawnX, posToSpawnY)) - return; + for (int px = 0; px < Map.Objects[x].TileSpanX; px++) + { + for (int py = 0; py < Map.Objects[x].TileSpanY; py++) + { + Vector2 posToCheck = Map.Objects[x].Position + new Vector2(px * Map.TileWidth, py * Map.TileHeight); + + if (posToCheck == new Vector2(posToSpawnX, posToSpawnY)) + return; + } + } + } + + // check if it isnt touching any walkable tiles + for (int px = 0; px < ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item1.TileSpanX; px++) + { + for (int py = 0; py < ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item1.TileSpanY; py++) + { + Vector2 posToCheck = new Vector2(posToSpawnX, posToSpawnY) + new Vector2(px * Map.TileWidth, py * Map.TileHeight); + + int tx = (int)posToCheck.X / Map.TileWidth; + int ty = (int)posToCheck.Y / Map.TileHeight; + + try + { + if (Map.TileMap[ty, tx].Direction != Direction.None) return; + } + catch { return; } + } } Money -= ParentScene.ObjectSeletor.Objects[ParentScene.ObjectSeletor.SelectedObjectIndex].Item2; diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index 71a826e..e7cb864 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -191,6 +191,11 @@ namespace Penguloon.Levels var b = new CannonObject(pos, this); Objects.Add(b); } + if (type == typeof(HealthGeneratorObject)) + { + var b = new HealthGeneratorObject(pos, this); + Objects.Add(b); + } } } diff --git a/Penguloon/Objects/CannonObject.cs b/Penguloon/Objects/CannonObject.cs index 916e617..41ed9bf 100644 --- a/Penguloon/Objects/CannonObject.cs +++ b/Penguloon/Objects/CannonObject.cs @@ -14,6 +14,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 3f; this.AttackSpeedMS = 2500; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectCannon); } public CannonObject(Map map) : base(map) @@ -23,6 +24,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 3f; this.AttackSpeedMS = 2500; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectCannon); } public override void DrawUnique(float deltaTime) diff --git a/Penguloon/Objects/GoldPenguinObject.cs b/Penguloon/Objects/GoldPenguinObject.cs index c406e2c..1b15131 100644 --- a/Penguloon/Objects/GoldPenguinObject.cs +++ b/Penguloon/Objects/GoldPenguinObject.cs @@ -14,6 +14,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 2.5f; this.AttackSpeedMS = 500; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectGoldPenguin); } public GoldPenguinObject(Map map) : base(map) @@ -23,6 +24,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 2.5f; this.AttackSpeedMS = 500; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectGoldPenguin); } public override void DrawUnique(float deltaTime) diff --git a/Penguloon/Objects/HealthGeneratorObject.cs b/Penguloon/Objects/HealthGeneratorObject.cs new file mode 100644 index 0000000..460387c --- /dev/null +++ b/Penguloon/Objects/HealthGeneratorObject.cs @@ -0,0 +1,54 @@ +using Microsoft.Xna.Framework; +using Penguloon.Levels; +using Penguloon.Projectiles; +using System.Collections.Generic; + +namespace Penguloon.Objects +{ + public class HealthGeneratorObject : ObjectBase + { + public HealthGeneratorObject(Vector2 position, Map map) : base(position, map) + { + this.Texture = ContentManager.GetTexture("Objects/healthRegenerator"); + this.TileSpanX = 2; + this.TileSpanY = 1; + this.Range = Map.TileWidth * 1f; + this.AttackSpeedMS = 9999999; + this.ShouldRotate = false; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectHospital); + } + + public HealthGeneratorObject(Map map) : base(map) + { + this.Texture = ContentManager.GetTexture("Objects/healthRegenerator"); + this.TileSpanX = 2; + this.TileSpanY = 1; + this.Range = Map.TileWidth * 1f; + this.AttackSpeedMS = 9999999; + this.ShouldRotate = false; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectHospital); + } + + public override void DrawUnique(float deltaTime) + { + + } + + public override void UpdateUnique(float deltaTime) + { + + } + + public override void RoundIsFinished() + { + base.RoundIsFinished(); + + Map.Level.Health += 25; + } + + public override void SpawnUnique() + { + + } + } +}
\ No newline at end of file diff --git a/Penguloon/Objects/ObjectBase.cs b/Penguloon/Objects/ObjectBase.cs index cde206d..9d00702 100644 --- a/Penguloon/Objects/ObjectBase.cs +++ b/Penguloon/Objects/ObjectBase.cs @@ -17,19 +17,23 @@ namespace Penguloon.Objects public Texture2D Texture { get; set; } public Texture2D RangeCircle { get; set; } - public float Rotation { get; set; } + public float Rotation { get; set; } = -0f; public Vector2 Position { get; set; } public Vector2 Center { get; set; } public int TileSpanX { get; set; } public int TileSpanY { get; set; } + public string infoText { get; set; } + public List<ProjectileBase> Projectiles { get; set; } = new List<ProjectileBase>(); public Map Map { get; set; } public Rectangle Box { get; set; } + public bool ShouldRotate { get; set; } = true; + public ObjectBase(Vector2 position, Map map) { this.Map = map; @@ -41,8 +45,20 @@ namespace Penguloon.Objects this.Map = map; } + public bool RoundFinished { get; set; } = true; + public void Update(float deltaTime) { + // round has started + if (Map.WaveManager.RoundActive && RoundFinished) + RoundFinished = false; + + if (!Map.WaveManager.RoundActive && !RoundFinished) + { + RoundFinished = true; + RoundIsFinished(); + } + this.Center = new Vector2(Position.X + ((TileSpanX * Map.TileWidth) / 2), Position.Y + ((TileSpanY * Map.TileHeight) / 2)); // loop from back of list to front so we always focus the balloons in front @@ -50,6 +66,7 @@ namespace Penguloon.Objects { if (Contains(Map.Enemies[i].Box.Center.ToVector2())) { + if(ShouldRotate) Rotation = (float)GetRotation(Map.Enemies[i].Box.Center.ToVector2()); if ((DateTime.Now - LastAttack).TotalMilliseconds > (AttackSpeedMS / (int)Map.Level.ParentScene.Speed)) @@ -69,6 +86,11 @@ namespace Penguloon.Objects RemoveUselessProjectiles(); } + public virtual void RoundIsFinished() + { + + } + private void RemoveUselessProjectiles() { for (int i = 0; i < Projectiles.Count; i++) @@ -110,8 +132,12 @@ namespace Penguloon.Objects if(RangeCircle == null) RangeCircle = CreateCircle((int)Range * 2); + float rot = (float)Rotation + (float)MathHelper.PiOver2; + if (!ShouldRotate) + rot = 0f; + Rectangle rec = new Rectangle( (int)Position.X + ((int)(Map.TileWidth * TileSpanX)) / 2, (int)Position.Y + ((int)(Map.TileHeight * TileSpanY)) / 2, diff --git a/Penguloon/Objects/PenguinObject.cs b/Penguloon/Objects/PenguinObject.cs index abb3c3a..a4fa389 100644 --- a/Penguloon/Objects/PenguinObject.cs +++ b/Penguloon/Objects/PenguinObject.cs @@ -14,6 +14,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 2; this.AttackSpeedMS = 1000; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectPenguin); } public PenguinObject(Map map) : base(map) @@ -23,6 +24,7 @@ namespace Penguloon.Objects this.TileSpanY = 1; this.Range = Map.TileWidth * 2; this.AttackSpeedMS = 1000; + this.infoText = map.Level.ParentScene.Main.Resources.GetString(Resource.String.ObjectPenguin); } public override void DrawUnique(float deltaTime) diff --git a/Penguloon/Penguloon.csproj b/Penguloon/Penguloon.csproj index 2f84d4b..5b919a8 100644 --- a/Penguloon/Penguloon.csproj +++ b/Penguloon/Penguloon.csproj @@ -84,11 +84,13 @@ <Compile Include="Levels\WaveManager.cs" /> <Compile Include="Objects\CannonObject.cs" /> <Compile Include="Objects\GoldPenguinObject.cs" /> + <Compile Include="Objects\HealthGeneratorObject.cs" /> <Compile Include="Objects\ObjectBase.cs" /> <Compile Include="Objects\PenguinObject.cs" /> <Compile Include="Projectiles\CannonballProjectile.cs" /> <Compile Include="Projectiles\ProjectileBase.cs" /> <Compile Include="Projectiles\SnowballProjectile.cs" /> + <Compile Include="Scenes\CreditsScene.cs" /> <Compile Include="Scenes\GameScene.cs" /> <Compile Include="Controls\LevelSelector.cs" /> <Compile Include="Enums.cs" /> diff --git a/Penguloon/Resources/Resource.Designer.cs b/Penguloon/Resources/Resource.Designer.cs index 34550cd..0cb9ca0 100644 --- a/Penguloon/Resources/Resource.Designer.cs +++ b/Penguloon/Resources/Resource.Designer.cs @@ -66,29 +66,32 @@ namespace Penguloon // aapt resource value: 0x7f030000 public const int ApplicationName = 2130903040; - // aapt resource value: 0x7f03000a - public const int IngameNo = 2130903050; + // aapt resource value: 0x7f03000f + public const int IngameNo = 2130903055; - // aapt resource value: 0x7f030004 - public const int IngameOptions = 2130903044; + // aapt resource value: 0x7f030005 + public const int IngameOptions = 2130903045; - // aapt resource value: 0x7f030006 - public const int IngameOptionsContinue = 2130903046; + // aapt resource value: 0x7f03000b + public const int IngameOptionsContinue = 2130903051; - // aapt resource value: 0x7f030007 - public const int IngameOptionsQuit = 2130903047; + // aapt resource value: 0x7f03000c + public const int IngameOptionsQuit = 2130903052; - // aapt resource value: 0x7f030008 - public const int IngameOptionsQuitConfirmation = 2130903048; + // aapt resource value: 0x7f03000d + public const int IngameOptionsQuitConfirmation = 2130903053; - // aapt resource value: 0x7f030005 - public const int IngameStart = 2130903045; + // aapt resource value: 0x7f030006 + public const int IngameStart = 2130903046; - // aapt resource value: 0x7f030009 - public const int IngameYes = 2130903049; + // aapt resource value: 0x7f03000e + public const int IngameYes = 2130903054; + + // aapt resource value: 0x7f030004 + public const int LevelSelectionBack = 2130903044; // aapt resource value: 0x7f030003 - public const int LevelSelectionBack = 2130903043; + public const int MenuBtnCredits = 2130903043; // aapt resource value: 0x7f030001 public const int MenuBtnPlay = 2130903041; @@ -96,29 +99,41 @@ namespace Penguloon // aapt resource value: 0x7f030002 public const int MenuBtnStats = 2130903042; - // aapt resource value: 0x7f030011 - public const int StatsBestKills = 2130903057; + // aapt resource value: 0x7f030009 + public const int ObjectCannon = 2130903049; - // aapt resource value: 0x7f030012 - public const int StatsBestRound = 2130903058; + // aapt resource value: 0x7f030008 + public const int ObjectGoldPenguin = 2130903048; - // aapt resource value: 0x7f030010 - public const int StatsBestStatsTitle = 2130903056; + // aapt resource value: 0x7f03000a + public const int ObjectHospital = 2130903050; - // aapt resource value: 0x7f03000b - public const int StatsLevel = 2130903051; + // aapt resource value: 0x7f030007 + public const int ObjectPenguin = 2130903047; - // aapt resource value: 0x7f03000e - public const int StatsTotalGames = 2130903054; + // aapt resource value: 0x7f030016 + public const int StatsBestKills = 2130903062; - // aapt resource value: 0x7f03000d - public const int StatsTotalKills = 2130903053; + // aapt resource value: 0x7f030017 + public const int StatsBestRound = 2130903063; - // aapt resource value: 0x7f03000f - public const int StatsTotalMoneySpent = 2130903055; + // aapt resource value: 0x7f030015 + public const int StatsBestStatsTitle = 2130903061; - // aapt resource value: 0x7f03000c - public const int StatsTotalStatsTitle = 2130903052; + // aapt resource value: 0x7f030010 + public const int StatsLevel = 2130903056; + + // aapt resource value: 0x7f030013 + public const int StatsTotalGames = 2130903059; + + // aapt resource value: 0x7f030012 + public const int StatsTotalKills = 2130903058; + + // aapt resource value: 0x7f030014 + public const int StatsTotalMoneySpent = 2130903060; + + // aapt resource value: 0x7f030011 + public const int StatsTotalStatsTitle = 2130903057; static String() { diff --git a/Penguloon/Resources/Values/Strings.xml b/Penguloon/Resources/Values/Strings.xml index feffcb2..c42c669 100644 --- a/Penguloon/Resources/Values/Strings.xml +++ b/Penguloon/Resources/Values/Strings.xml @@ -5,6 +5,7 @@ <!-- menu --> <string name="MenuBtnPlay">Play</string> <string name="MenuBtnStats">Stats</string> + <string name="MenuBtnCredits">Credits</string> <!-- level selection --> <string name="LevelSelectionBack">Back</string> @@ -13,6 +14,12 @@ <string name="IngameOptions">Options</string> <string name="IngameStart">Start</string> + <!-- objects info text --> + <string name="ObjectPenguin">This penguin does not like \n balloons</string> + <string name="ObjectGoldPenguin">This penguin king shoots \n even faster than regular \n penguins</string> + <string name="ObjectCannon">This penguin manufactored \n cannon can pop multiple \n balloons at once!</string> + <string name="ObjectHospital">This weird object restores \n health after every round..</string> + <!-- ingame options menu --> <string name="IngameOptionsContinue">Continue</string> <string name="IngameOptionsQuit">Quit</string> diff --git a/Penguloon/SceneManager.cs b/Penguloon/SceneManager.cs index dd399e9..83bc64e 100644 --- a/Penguloon/SceneManager.cs +++ b/Penguloon/SceneManager.cs @@ -17,6 +17,8 @@ namespace Penguloon public static SceneBase StatsScene { get; set; } + public static SceneBase CreditsScene { get; set; } + /// <summary> /// Initialize scene manager. /// </summary> @@ -43,6 +45,8 @@ namespace Penguloon LoadingScene.Draw(deltaTime); break; case SelectedScene.Stats: StatsScene.Draw(deltaTime); break; + case SelectedScene.Credits: + CreditsScene.Draw(deltaTime); break; default: return; @@ -68,6 +72,8 @@ namespace Penguloon LoadingScene.Update(deltaTime, touchLocations); break; case SelectedScene.Stats: StatsScene.Update(deltaTime, touchLocations); break; + case SelectedScene.Credits: + CreditsScene.Update(deltaTime, touchLocations); break; default: return; diff --git a/Penguloon/Scenes/CreditsScene.cs b/Penguloon/Scenes/CreditsScene.cs new file mode 100644 index 0000000..f07e5e1 --- /dev/null +++ b/Penguloon/Scenes/CreditsScene.cs @@ -0,0 +1,182 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input.Touch; +using Penguloon.Scenes; +using System; +using System.Collections.Generic; + +namespace Penguloon.Scenes +{ + class CreditsScene : SceneBase + { + public float PosY { get; set; } + + public SpriteFont Font { get; set; } + public int TextHeight { get; set; } + + public DateTime ViewDate { get; set; } + + public CreditsScene(Main main) : base(main) + { + Font = ContentManager.GetFont(StaticUIValues.StatsFont); + TextHeight = (int)Font.MeasureString("zulul").Y * 2; + + ViewDate = DateTime.Now; + } + + public override void CreateControls() + { + + } + + public override void Draw(float deltaTime) + { + base.Draw(deltaTime); + + // background + Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/background"), + destinationRectangle: new Rectangle(0, 0, (int)StaticUIValues.ScreenViewport.X, (int)StaticUIValues.ScreenViewport.Y)); + + DrawSnowflakes(); + + DrawCredits(); + } + + public List<string> CreditList { get; set; } = new List<string>() + { + "Executive Producer", + "Team Lead", + "Art Director", + "Creative Director", + "Lead Animator", + "Lead Artist", + "Lead Character Artist", + "Lead Designer", + "Load Programmer", + "Lead Technical Artist", + "Producer", + "Additional Production", + "Programming", + "Additional Programming", + "Level Designer", + "Sound Producer", + "Audio Supervisor", + "lead Composer", + "Lead Sound Designer", + "Music", + "Sound Design", + "Sound Editor", + "Quality Assurance Manager", + "Test Coordinator", + "Test Leads", + "Lead Game Testers", + "Game Testers", + "Senior Lead Testers", + "Additional Game Testing", + "In-Game Support Team", + "Marketing Team", + "Legal Manager", + "President", + "CEO", + "Commercial Director", + "Sales Manager", + "Marketing Manager", + "PR Manager", + "Logistics", + "Sales Director", + "Product Manager", + "Managing Director", + "Community Manager", + "Vice President", + "Trade Marketing", + "Social Media Executive", + "Publishing", + "Associate Tools Engineer", + "Digital Coordinator", + "IP Strategy", + "Digital Business Manager", + "Digital Coordinator", + "Adinistration", + "Administrative Assistant", + "Operations Analyst", + "Applications Support Specialist", + "Travel Adinistrator", + "Senior Vice President", + "Director of Retail Marketing", + "E-Commerce Specialist", + "Brand Marketing", + "Brand Manager", + "Event Manager", + "Event Planner", + "Community Specialist", + "Interactive Designer", + "Senior Associate Attorney", + "QA Manager", + "QA Project Leads", + "CQC Manager", + "Senior CQC Coordinator", + "CQC Coordinators", + "CQC Testers", + "Digital Content Manager", + "Finaince Manager", + "Accountant", + "Sales Representative", + "Business Administrator", + "Marketing Assistant", + "Localization Manager", + "Product Support", + "Business Development", + "Special Thanks", + }; + + private void DrawCredits() + { + int marginTop = (int)(StaticUIValues.ScreenViewport.Y / 2) + (int)PosY; + string name = "Aldrik Ramaekers"; + + Color headerForeColor = Color.FromNonPremultiplied(111, 138, 183, 255); + Color headerBackColor = Color.Black; + + Color nameForeColor = Color.White; + Color nameBackColor = Color.Black; + + // game design + DrawText(Font, "Game Design", new Vector2(0, marginTop + TextHeight), new Vector2(StaticUIValues.ScreenViewport.X, 0), TextAllignment.CenterTop, headerForeColor, headerBackColor, 2); + DrawText(Font, name, new Vector2(0, marginTop + TextHeight + (TextHeight / 2)), new Vector2(StaticUIValues.ScreenViewport.X, 0), TextAllignment.CenterTop, nameForeColor, nameBackColor, 2); + + for (int i = 0; i < CreditList.Count; i++) + { + int posX = i % 2 == 0 ? 100 : (int)StaticUIValues.ScreenViewport.X - 100; + TextAllignment align = i % 2 == 0 ? TextAllignment.LeftTop : TextAllignment.RightTop; + + int index = i + 2; + + int posY = marginTop + ((int)(TextHeight * 0.7) * (index * 2)); + + if (posY < -200) continue; + if (posY > StaticUIValues.ScreenViewport.Y) break; + + if (i == CreditList.Count - 1) + name = "My cat"; + else + name = "Aldrik Ramaekers"; + + // executive producer + DrawText(Font, CreditList[i], new Vector2(posX, posY), new Vector2(0, 0), align, headerForeColor, headerBackColor, 2); + DrawText(Font, name, new Vector2(posX, posY + (TextHeight / 2)), new Vector2(0, 0), align, nameForeColor, nameBackColor, 2); + } + } + + public override void Update(float deltaTime, TouchLocation[] touchLocations) + { + base.Update(deltaTime, touchLocations); + + if (touchLocations.Length != 0) + if ((DateTime.Now - ViewDate).TotalMilliseconds > 200) + SceneManager.SelectedScene = SelectedScene.Menu; + + PosY -= 100 * deltaTime; + } + } +}
\ No newline at end of file diff --git a/Penguloon/Scenes/GameScene.cs b/Penguloon/Scenes/GameScene.cs index 7248730..5412147 100644 --- a/Penguloon/Scenes/GameScene.cs +++ b/Penguloon/Scenes/GameScene.cs @@ -110,7 +110,7 @@ namespace Penguloon.Scenes private void DrawUI(float deltaTime) { //background - Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/red"), + Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/objectSelectionBackground"), destinationRectangle: new Rectangle(Level.Map.MapWidth + StaticUIValues.BorderWidth, 0, (int)StaticUIValues.ScreenViewport.X - (Level.Map.MapWidth + StaticUIValues.BorderWidth), (int)StaticUIValues.ScreenViewport.Y)); diff --git a/Penguloon/Scenes/MenuScene.cs b/Penguloon/Scenes/MenuScene.cs index 7957151..cab9f8c 100644 --- a/Penguloon/Scenes/MenuScene.cs +++ b/Penguloon/Scenes/MenuScene.cs @@ -22,11 +22,24 @@ namespace Penguloon.Scenes new Vector2((StaticUIValues.ScreenViewport.X - StaticUIValues.MenuButtonSize.X) / 2, 100 + StaticUIValues.MenuButtonSize.Y + 25), StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.MenuBtnStats)); + Button btnCredits = new Button(this, + new Vector2((StaticUIValues.ScreenViewport.X - StaticUIValues.MenuButtonSize.X) / 2, 100 + (StaticUIValues.MenuButtonSize.Y * 2) + (25 * 2)), + StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.MenuBtnCredits)); + btnStart.OnClick += BtnStart_OnClick; btnStats.OnClick += BtnStats_OnClick; + btnCredits.OnClick += BtnCredits_OnClick; Controls.Add(btnStart); Controls.Add(btnStats); + Controls.Add(btnCredits); + } + + private void BtnCredits_OnClick(object sender, ClickArgs e) + { + SceneManager.CreditsScene = new CreditsScene(Main); + + SceneManager.SelectedScene = SelectedScene.Credits; } private void BtnStats_OnClick(object sender, ClickArgs e) @@ -39,7 +52,6 @@ namespace Penguloon.Scenes private void BtnStart_OnClick(object sender, ClickArgs e) { - if(SceneManager.LevelSelectionScene == null) SceneManager.LevelSelectionScene = new LevelSelectionScene(Main); SceneManager.SelectedScene = SelectedScene.LevelSelection; diff --git a/Penguloon/Scenes/StatsScene.cs b/Penguloon/Scenes/StatsScene.cs index 948e77f..f6885d8 100644 --- a/Penguloon/Scenes/StatsScene.cs +++ b/Penguloon/Scenes/StatsScene.cs @@ -64,7 +64,7 @@ namespace Penguloon.Scenes Main.Resources.GetString(Resource.String.StatsTotalStatsTitle), new Vector2(120, borderHorizontalY), new Vector2(0, 0), - TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + TextAllignment.LeftTop, Color.FromNonPremultiplied(111, 138, 183, 255), Color.Black, 2); int martinXRight = StaticUIValues.StatsMarginXRight; @@ -78,7 +78,7 @@ namespace Penguloon.Scenes Main.Resources.GetString(Resource.String.StatsLevel) + " ", new Vector2((int)StaticUIValues.ScreenViewport.X - martinXRight - ContentManager.GetFont(StaticUIValues.StatsFont).MeasureString(UserdataManager.Level.ToString()).X, 75), new Vector2(0, 0), - TextAllignment.RightTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + TextAllignment.RightTop, Color.FromNonPremultiplied(111, 138, 183, 255), Color.Black, 2); // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), @@ -128,7 +128,7 @@ namespace Penguloon.Scenes Main.Resources.GetString(Resource.String.StatsBestStatsTitle), new Vector2(120, borderHorizontalY + 50 + (StaticUIValues.StatsSpacingY * 4)), new Vector2(0, 0), - TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + TextAllignment.LeftTop, Color.FromNonPremultiplied(111, 138, 183, 255), Color.Black, 2); // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), diff --git a/Penguloon/SoundManager.cs b/Penguloon/SoundManager.cs index 8ec0ca7..e665197 100644 --- a/Penguloon/SoundManager.cs +++ b/Penguloon/SoundManager.cs @@ -6,6 +6,7 @@ namespace Penguloon { public static SoundEffectInstance Baseline { get; set; } public static SoundEffectInstance BtnClick { get; set; } + public static SoundEffectInstance BtnClick2 { get; set; } public static void StartBaseline() { @@ -29,6 +30,19 @@ namespace Penguloon BtnClick.Play(); } + public static void PlayClickSound2() + { + if (BtnClick2 == null) + { + SoundEffect effect = ContentManager.GetSound("Sounds/click2"); + BtnClick2 = effect.CreateInstance(); + BtnClick2.Volume = 1f; + BtnClick2.IsLooped = false; + } + + BtnClick2.Play(); + } + public static void PlayBalloonPopSound() { SoundEffect popEffect = ContentManager.GetSound("Sounds/pop"); diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs index afda2ce..3a461a1 100644 --- a/Penguloon/StaticUIValues.cs +++ b/Penguloon/StaticUIValues.cs @@ -39,6 +39,8 @@ namespace Penguloon public static Vector2 IngameOptionsSize { get; set; } + public static Vector2 IngameInfoPanelSize { get; set; } + public static void Initialize(Main main) { ScreenViewport = main.GraphicsDevice.Viewport.Bounds.Size.ToVector2(); @@ -61,6 +63,7 @@ namespace Penguloon IngameUITextAreaHeight = 160; StatsMarginXRight = 150; LoadingScreenTitle = "Fonts/GWENT/192"; + IngameInfoPanelSize = new Vector2((int)(800 * 0.8), (int)(400 * 0.8)); } else if (ScreenViewport.X >= 1920) { @@ -78,6 +81,7 @@ namespace Penguloon IngameUITextAreaHeight = 160; StatsMarginXRight = 150; LoadingScreenTitle = "Fonts/GWENT/192"; + IngameInfoPanelSize = new Vector2((int)(800 * 0.8), (int)(400 * 0.8)); } else if (ScreenViewport.X >= 1280) { @@ -94,6 +98,7 @@ namespace Penguloon IngameUITextAreaHeight = 120; StatsMarginXRight = 100; LoadingScreenTitle = "Fonts/GWENT/128"; + IngameInfoPanelSize = new Vector2((int)(800 * 0.55), (int)(400 * 0.55)); } else { @@ -110,6 +115,7 @@ namespace Penguloon IngameUITextAreaHeight = 120; StatsMarginXRight = 100; LoadingScreenTitle = "Fonts/GWENT/128"; + IngameInfoPanelSize = new Vector2((int)(800 * 0.55), (int)(400 * 0.55)); } LoadingProgressbarPosition = new Vector2((ScreenViewport.X - LoadingProgressbarSize.X) / 2, ScreenViewport.Y - LoadingProgressbarSize.Y - 200); |
