-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Score screen #1209
Score screen #1209
Conversation
Codecov Report
@@ Coverage Diff @@
## feature-1121-score-screen #1209 +/- ##
=============================================================
+ Coverage 63.20% 63.35% +0.15%
=============================================================
Files 345 347 +2
Lines 7866 7901 +35
=============================================================
+ Hits 4972 5006 +34
- Misses 2894 2895 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Pull Request Test Coverage Report for Build 964811730
💛 - Coveralls |
_spriteBatch = spriteBatch; | ||
|
||
var buttonTexture = game.Content.Load<Texture2D>("Sprites/ui/button"); | ||
var font = Game.Content.Load<SpriteFont>("Fonts/Main"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should get main font and button texture from IUiContentStorage
to prevent multiple loading of same resources.
title: UiResources.NextScreenButtonTitle, | ||
texture: buttonTexture, | ||
font: font, | ||
rect: new Rectangle(x: 550, y: 150, width: 100, height: 20)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use magic numbers. Instead use named constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are magic numbers? It's just a position of the button and other parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const int BUTTON_WIDTH = 100;
const int BUTTON_HEIGHT = 20;
const int BUTTON_STACK_X = 150;
const int BUTTON_STACK_Y = 150;
_goToNextScreen = new TextButton(
title: UiResources.NextScreenButtonTitle,
texture: buttonTexture,
font: font,
rect: new Rectangle(
x: BUTTON_STACK_X + BUTTON_WIDTH * 2 ,
y: BUTTON_STACK_Y ,
width: BUTTON_WIDTH,
height: BUTTON_HEIGHT));
It's better to maintain and understand that just x: 550, y: 150, width: 100, height: 20
var state = Keyboard.GetState(); | ||
|
||
// If they hit esc, exit | ||
if (state.IsKeyDown(Keys.Escape)) | ||
{ | ||
Game.Exit(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like copy-pasta. We should exit game the Keys.Escape
.
|
||
_spriteBatch.DrawString( | ||
spriteFont: font, | ||
text: "Score menu", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localize all output strings via UiResources. The easiest way to manage resources is ResX extension described in README.md
title: UiResources.NextScreenButtonTitle, | ||
texture: buttonTexture, | ||
font: font, | ||
rect: new Rectangle(x: 550, y: 150, width: 100, height: 20)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const int BUTTON_WIDTH = 100;
const int BUTTON_HEIGHT = 20;
const int BUTTON_STACK_X = 150;
const int BUTTON_STACK_Y = 150;
_goToNextScreen = new TextButton(
title: UiResources.NextScreenButtonTitle,
texture: buttonTexture,
font: font,
rect: new Rectangle(
x: BUTTON_STACK_X + BUTTON_WIDTH * 2 ,
y: BUTTON_STACK_Y ,
width: BUTTON_WIDTH,
height: BUTTON_HEIGHT));
It's better to maintain and understand that just x: 550, y: 150, width: 100, height: 20
@@ -54,7 +54,7 @@ private void ProcessIfHealth(SurvivalStat stat, int valueDiff) | |||
return; | |||
} | |||
|
|||
var hp = stat.Value; | |||
var hp = 0; //stat.Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
I thing this is test changes. This is not for master branch.
it's better to test via cheat input component. There is no way to manipulate person attributes. But you can add wanted cheat easely.
…Roguelike into score-screen � Conflicts: � Zilon.Core/CDT.LAST.MonoGameClient/Screens/LeaderBoardScreen.cs � Zilon.Core/CDT.LAST.MonoGameClient/Screens/ScoresScreen.cs
Part of #1120
Part of #1121
Changes
Checklist