diff options
Diffstat (limited to 'Penguloon')
| -rw-r--r-- | Penguloon/Activity.cs | 2 | ||||
| -rw-r--r-- | Penguloon/Content/Content.mgcb | 19 | ||||
| -rw-r--r-- | Penguloon/Content/Fonts/GWENT/192.spritefont | 60 | ||||
| -rw-r--r-- | Penguloon/Content/SplashArt/1.png | bin | 4238 -> 29248 bytes | |||
| -rw-r--r-- | Penguloon/Content/UI/unselectableTile.png | bin | 0 -> 305 bytes | |||
| -rw-r--r-- | Penguloon/ContentPathManager.cs | 2 | ||||
| -rw-r--r-- | Penguloon/Controls/LevelSelector.cs | 25 | ||||
| -rw-r--r-- | Penguloon/Levels/IceLevel.cs | 2 | ||||
| -rw-r--r-- | Penguloon/Levels/Map.cs | 10 | ||||
| -rw-r--r-- | Penguloon/Scenes/LevelSelectionScene.cs | 2 | ||||
| -rw-r--r-- | Penguloon/Scenes/LoadingScene.cs | 4 | ||||
| -rw-r--r-- | Penguloon/Scenes/StatsScene.cs | 28 | ||||
| -rw-r--r-- | Penguloon/StaticUIValues.cs | 20 |
13 files changed, 139 insertions, 35 deletions
diff --git a/Penguloon/Activity.cs b/Penguloon/Activity.cs index 1a01358..d5c5562 100644 --- a/Penguloon/Activity.cs +++ b/Penguloon/Activity.cs @@ -11,7 +11,7 @@ namespace Penguloon , Theme = "@style/Theme.Splash" , AlwaysRetainTaskState = true , LaunchMode = Android.Content.PM.LaunchMode.SingleInstance - , ScreenOrientation = ScreenOrientation.Landscape + , ScreenOrientation = ScreenOrientation.UserLandscape , ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)] public class Activity : Microsoft.Xna.Framework.AndroidGameActivity { diff --git a/Penguloon/Content/Content.mgcb b/Penguloon/Content/Content.mgcb index 0ae8103..b8e9f20 100644 --- a/Penguloon/Content/Content.mgcb +++ b/Penguloon/Content/Content.mgcb @@ -558,3 +558,22 @@ /processorParam:TextureFormat=Compressed /build:Fonts/GWENT/52.spritefont +#begin Fonts/GWENT/192.spritefont +/importer:FontDescriptionImporter +/processor:FontDescriptionProcessor +/processorParam:PremultiplyAlpha=True +/processorParam:TextureFormat=Compressed +/build:Fonts/GWENT/192.spritefont + +#begin UI/unselectableTile.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/unselectableTile.png + diff --git a/Penguloon/Content/Fonts/GWENT/192.spritefont b/Penguloon/Content/Fonts/GWENT/192.spritefont new file mode 100644 index 0000000..511680b --- /dev/null +++ b/Penguloon/Content/Fonts/GWENT/192.spritefont @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +This file contains an xml description of a font, and will be read by the XNA +Framework Content Pipeline. Follow the comments to customize the appearance +of the font in your game, and to change the characters which are available to draw +with. +--> +<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics"> + <Asset Type="Graphics:FontDescription"> + + <!-- + Modify this string to change the font that will be imported. + --> + <FontName>GWENT.ttf</FontName> + + <!-- + Size is a float value, measured in points. Modify this value to change + the size of the font. + --> + <Size>192</Size> + + <!-- + Spacing is a float value, measured in pixels. Modify this value to change + the amount of spacing in between characters. + --> + <Spacing>0</Spacing> + + <!-- + UseKerning controls the layout of the font. If this value is true, kerning information + will be used when placing characters. + --> + <UseKerning>true</UseKerning> + + <!-- + Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic", + and "Bold, Italic", and are case sensitive. + --> + <Style>Regular</Style> + + <!-- + If you uncomment this line, the default character will be substituted if you draw + or measure text that contains characters which were not included in the font. + --> + <!-- <DefaultCharacter>*</DefaultCharacter> --> + + <!-- + CharacterRegions control what letters are available in the font. Every + character from Start to End will be built and made available for drawing. The + default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin + character set. The characters are ordered according to the Unicode standard. + See the documentation for more information. + --> + <CharacterRegions> + <CharacterRegion> + <Start> </Start> + <End>~</End> + </CharacterRegion> + </CharacterRegions> + </Asset> +</XnaContent> diff --git a/Penguloon/Content/SplashArt/1.png b/Penguloon/Content/SplashArt/1.png Binary files differindex 4091ca6..48d4390 100644 --- a/Penguloon/Content/SplashArt/1.png +++ b/Penguloon/Content/SplashArt/1.png diff --git a/Penguloon/Content/UI/unselectableTile.png b/Penguloon/Content/UI/unselectableTile.png Binary files differnew file mode 100644 index 0000000..973f797 --- /dev/null +++ b/Penguloon/Content/UI/unselectableTile.png diff --git a/Penguloon/ContentPathManager.cs b/Penguloon/ContentPathManager.cs index 4996aa4..9086f24 100644 --- a/Penguloon/ContentPathManager.cs +++ b/Penguloon/ContentPathManager.cs @@ -44,6 +44,7 @@ namespace Penguloon "UI/lightred", "UI/optionsMenuBackground", "UI/msgBoxBackground", + "UI/unselectableTile", "SplashArt/1", @@ -86,6 +87,7 @@ namespace Penguloon public static List<string> FontPathsPreLoad { get; set; } = new List<string>() { "Fonts/GWENT/128", + "Fonts/GWENT/192", }; public static List<string> SoundPathsPreLoad { get; set; } = new List<string>() diff --git a/Penguloon/Controls/LevelSelector.cs b/Penguloon/Controls/LevelSelector.cs index 6437773..4878e4c 100644 --- a/Penguloon/Controls/LevelSelector.cs +++ b/Penguloon/Controls/LevelSelector.cs @@ -27,17 +27,18 @@ namespace Penguloon.Controls this.BackgroundPressed = ContentManager.GetTexture("UI/btnIdle"); this.BackgroundDisabled = ContentManager.GetTexture("UI/btnIdle"); - PanelWidth = (int)(StaticUIValues.ScreenViewport.X - ((MaxPanels + 1) * PanelMarginX)) / MaxPanels; + PanelWidth = ((int)((StaticUIValues.ScreenViewport.X - ((MaxPanels + 1) * PanelMarginX)) / MaxPanels)); - int panel1posX = PanelMarginX + (PanelMarginX * 0) + (PanelWidth * 0); - int panel2posX = PanelMarginX + (PanelMarginX * 1) + (PanelWidth * 1); - int panel3posX = PanelMarginX + (PanelMarginX * 2) + (PanelWidth * 2); + int panel1posX = (PanelMarginX + (PanelMarginX * 0) + (PanelWidth * 0)) + 20; + int panel2posX = (PanelMarginX + (PanelMarginX * 1) + (PanelWidth * 1)); + int panel3posX = (PanelMarginX + (PanelMarginX * 2) + (PanelWidth * 2)) - 20; int sidePanelMarginY = 25; + int centerPanelWidth = (int)(PanelWidth * 1.2); - Panel1 = new Rectangle(panel1posX, (int)position.Y + (sidePanelMarginY / 2), PanelWidth, (int)size.Y - sidePanelMarginY); - Panel2 = new Rectangle(panel2posX, (int)position.Y, PanelWidth, (int)size.Y); - Panel3 = new Rectangle(panel3posX, (int)position.Y + (sidePanelMarginY / 2), PanelWidth, (int)size.Y - sidePanelMarginY); + 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); this.OnClick += LevelSelector_OnClick; @@ -69,8 +70,8 @@ namespace Penguloon.Controls private void CreateLevels() { Levels.Add(new IceLevel()); - //Levels.Add(new IceLevel()); - //Levels.Add(new IceLevel()); + Levels.Add(new IceLevel()); + Levels.Add(new IceLevel()); } public override void Draw(float deltaTime) @@ -89,14 +90,14 @@ namespace Penguloon.Controls destinationRectangle: Panel1); } - ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap].SplashArt, - destinationRectangle: Panel2); - if (selectedMap + 1 < Levels.Count) { ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap + 1].SplashArt, destinationRectangle: Panel3); } + + ParentScene.Main.SpriteBatch.Draw(Levels[selectedMap].SplashArt, + destinationRectangle: Panel2); } } }
\ No newline at end of file diff --git a/Penguloon/Levels/IceLevel.cs b/Penguloon/Levels/IceLevel.cs index 615924f..237ebf8 100644 --- a/Penguloon/Levels/IceLevel.cs +++ b/Penguloon/Levels/IceLevel.cs @@ -66,7 +66,7 @@ namespace Penguloon.Levels //Map.Objects.Add(new GoldPenguinObject(new Vector2(0, 0), Map)); //Map.Objects.Add(new GoldPenguinObject(new Vector2(Map.TileWidth * 2, Map.TileHeight * 4), Map)); - Map.Objects.Add(new GoldPenguinObject(new Vector2(Map.TileWidth * 1, Map.TileHeight * 8), Map)); + //Map.Objects.Add(new GoldPenguinObject(new Vector2(Map.TileWidth * 1, Map.TileHeight * 8), Map)); } } }
\ No newline at end of file diff --git a/Penguloon/Levels/Map.cs b/Penguloon/Levels/Map.cs index bb574d5..71a826e 100644 --- a/Penguloon/Levels/Map.cs +++ b/Penguloon/Levels/Map.cs @@ -19,7 +19,7 @@ namespace Penguloon.Levels public int TileWidth { get; private set; } public int TileHeight { get; private set; } - public SceneBase ParentScene { get; set; } + public GameScene ParentScene { get; set; } public List<EnemyBase> Enemies { get; set; } = new List<EnemyBase>(); public List<ObjectBase> Objects { get; set; } = new List<ObjectBase>(); @@ -32,7 +32,7 @@ namespace Penguloon.Levels public LevelBase Level { get; set; } - public Map(SceneBase parentScene, LevelBase level) + public Map(GameScene parentScene, LevelBase level) { this.ParentScene = parentScene; this.Level = level; @@ -63,11 +63,15 @@ namespace Penguloon.Levels for (int y = 0; y < TileMap.GetLength(0); y++) { for (int x = 0; x < TileMap.GetLength(1); x++) - { + { Texture2D tileTexture = ContentManager.GetTileTextureByType(TileMap[y, x].Type); ParentScene.Main.SpriteBatch.Draw(tileTexture, destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight)); + + //if (ParentScene.ObjectSeletor.State == Controls.State.Selected) + // ParentScene.Main.SpriteBatch.Draw(tileTexture, + // destinationRectangle: new Rectangle(x * TileWidth, y * TileHeight, TileWidth, TileHeight)); } } diff --git a/Penguloon/Scenes/LevelSelectionScene.cs b/Penguloon/Scenes/LevelSelectionScene.cs index dbc6601..68f71ca 100644 --- a/Penguloon/Scenes/LevelSelectionScene.cs +++ b/Penguloon/Scenes/LevelSelectionScene.cs @@ -14,7 +14,7 @@ namespace Penguloon.Scenes public override void CreateControls() { Button btnBack = new Button(this, - new Vector2(10, 10), + new Vector2(50, 50), StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.LevelSelectionBack)); btnBack.OnClick += BtnStart_OnClick; diff --git a/Penguloon/Scenes/LoadingScene.cs b/Penguloon/Scenes/LoadingScene.cs index 19f0215..bd765d1 100644 --- a/Penguloon/Scenes/LoadingScene.cs +++ b/Penguloon/Scenes/LoadingScene.cs @@ -36,8 +36,8 @@ namespace Penguloon.Scenes DrawProgressbar(); // draw title - DrawText(ContentManager.GetFont("Fonts/GWENT/128"), "Penguloon", new Vector2(0, 100), - StaticUIValues.ScreenViewport, TextAllignment.CenterTop, Color.Red, Color.Black, 5); + DrawText(ContentManager.GetFont(StaticUIValues.LoadingScreenTitle), "Penguloon", new Vector2(0, 100), + StaticUIValues.ScreenViewport, TextAllignment.CenterTop, Color.Red, Color.Black, 4); } /// <summary> diff --git a/Penguloon/Scenes/StatsScene.cs b/Penguloon/Scenes/StatsScene.cs index c488f81..aa5dd29 100644 --- a/Penguloon/Scenes/StatsScene.cs +++ b/Penguloon/Scenes/StatsScene.cs @@ -15,7 +15,7 @@ namespace Penguloon.Scenes public override void CreateControls() { Button btnBack = new Button(this, - new Vector2(10, 10), + new Vector2(50, 50), StaticUIValues.MenuButtonSize, Main.Resources.GetString(Resource.String.LevelSelectionBack)); btnBack.OnClick += BtnStart_OnClick; @@ -36,7 +36,7 @@ namespace Penguloon.Scenes DrawSnowflakes(); - int borderHorizontalY = 10 + (int)StaticUIValues.MenuButtonSize.Y + 50; + int borderHorizontalY = 50 + (int)StaticUIValues.MenuButtonSize.Y + 50; //border top Main.SpriteBatch.Draw(ContentManager.GetTexture("UI/border-horizontal"), @@ -66,45 +66,47 @@ namespace Penguloon.Scenes new Vector2(0, 0), TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); + int martinXRight = StaticUIValues.StatsMarginXRight; + // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalKills), - new Vector2(120, borderHorizontalY + 25 + (60 * 1)), + new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 1)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total kills stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.TotalKills.ToString(), - new Vector2(920, borderHorizontalY + 25 + (60 * 1)), + new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 1)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total games DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalGames), - new Vector2(120, borderHorizontalY + 25 + (60 * 2)), + new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 2)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total games stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.GamesPlayed.ToString(), - new Vector2(920, borderHorizontalY + 25 + (60 * 2)), + new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 2)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total money spent DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsTotalMoneySpent), - new Vector2(120, borderHorizontalY + 25 + (60 * 3)), + new Vector2(120, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 3)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total money spent stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.TotalMoneySpent.ToString(), - new Vector2(920, borderHorizontalY + 25 + (60 * 3)), + new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 25 + (StaticUIValues.StatsSpacingY * 3)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); @@ -112,35 +114,35 @@ namespace Penguloon.Scenes DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestStatsTitle), - new Vector2(120, borderHorizontalY + 50 + (60 * 4)), + new Vector2(120, borderHorizontalY + 50 + (StaticUIValues.StatsSpacingY * 4)), new Vector2(0, 0), TextAllignment.LeftTop, Color.FromNonPremultiplied(200, 200, 200, 200), Color.Black, 2); // Total kills DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestKills), - new Vector2(120, borderHorizontalY + 75 + (60 * 5)), + new Vector2(120, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 5)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total kills stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.HighestKills.ToString(), - new Vector2(920, borderHorizontalY + 75 + (60 * 5)), + new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 5)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); // Total games DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), Main.Resources.GetString(Resource.String.StatsBestRound), - new Vector2(120, borderHorizontalY + 75 + (60 * 6)), + new Vector2(120, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 6)), new Vector2(0, 0), TextAllignment.LeftTop, Color.White, Color.Black, 2); // Total games stat DrawText(ContentManager.GetFont(StaticUIValues.StatsFont), UserdataManager.HighestRound.ToString(), - new Vector2(920, borderHorizontalY + 75 + (60 * 6)), + new Vector2(StaticUIValues.ScreenViewport.X - martinXRight, borderHorizontalY + 75 + (StaticUIValues.StatsSpacingY * 6)), new Vector2(0, 0), TextAllignment.RightTop, Color.White, Color.Black, 2); } diff --git a/Penguloon/StaticUIValues.cs b/Penguloon/StaticUIValues.cs index 0734bad..afda2ce 100644 --- a/Penguloon/StaticUIValues.cs +++ b/Penguloon/StaticUIValues.cs @@ -11,6 +11,8 @@ namespace Penguloon public static Vector2 LoadingProgressbarPosition { get; set; } public static Vector2 LoadingProgressbarValuePosition { get; set; } + public static string LoadingScreenTitle { get; set; } + public static int LevelSelectorHeight { get; set; } public static Vector2 MenuButtonSize { get; set; } @@ -22,6 +24,8 @@ namespace Penguloon public static string IngameFont { get; set; } public static string StatsFont { get; set; } + public static int StatsSpacingY { get; set; } + public static int StatsMarginXRight { get; set; } public static int IngameUIWidth { get; set; } @@ -52,8 +56,11 @@ namespace Penguloon ChangeSpeedButtonWidth = 200; IngameOptionsSize = new Vector2(800, 1000); IngameFont = "Fonts/GWENT/36"; - StatsFont = "Fonts/GWENT/48"; + StatsFont = "Fonts/GWENT/72"; + StatsSpacingY = 90; IngameUITextAreaHeight = 160; + StatsMarginXRight = 150; + LoadingScreenTitle = "Fonts/GWENT/192"; } else if (ScreenViewport.X >= 1920) { @@ -66,8 +73,11 @@ namespace Penguloon ChangeSpeedButtonWidth = 200; IngameOptionsSize = new Vector2((int)(800 * 0.85), (int)(1000 * 0.85)); IngameFont = "Fonts/GWENT/36"; - StatsFont = "Fonts/GWENT/48"; + StatsFont = "Fonts/GWENT/72"; + StatsSpacingY = 90; IngameUITextAreaHeight = 160; + StatsMarginXRight = 150; + LoadingScreenTitle = "Fonts/GWENT/192"; } else if (ScreenViewport.X >= 1280) { @@ -80,7 +90,10 @@ namespace Penguloon IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); IngameFont = "Fonts/GWENT/24"; StatsFont = "Fonts/GWENT/48"; + StatsSpacingY = 60; IngameUITextAreaHeight = 120; + StatsMarginXRight = 100; + LoadingScreenTitle = "Fonts/GWENT/128"; } else { @@ -93,7 +106,10 @@ namespace Penguloon IngameOptionsSize = new Vector2((int)(800 * 0.7), (int)(1000 * 0.7)); IngameFont = "Fonts/GWENT/24"; StatsFont = "Fonts/GWENT/48"; + StatsSpacingY = 60; IngameUITextAreaHeight = 120; + StatsMarginXRight = 100; + LoadingScreenTitle = "Fonts/GWENT/128"; } LoadingProgressbarPosition = new Vector2((ScreenViewport.X - LoadingProgressbarSize.X) / 2, ScreenViewport.Y - LoadingProgressbarSize.Y - 200); |
