Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Perdue committed Mar 13, 2022
1 parent fbd381f commit ae7f359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Characters/Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private void heavyAttack()
float yMovement = -prepareDirection[1];
Position = new Vector2(Position.X + xMovement, Position.Y + yMovement);
attackDirection = prepareDirection;
((Fists)weapon).Lunge(0.04f, false);
((Fists)weapon).Lunge(2f, false);
}
}
}
Expand Down
14 changes: 11 additions & 3 deletions Characters/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Player : Character
private RectangleButton restartButton;
private bool paused = false;
private Panel pausePanel;
private Picture logo;
public Label scoreLabel;
public Player()
{
Expand Down Expand Up @@ -124,6 +125,7 @@ public void restart(Point location)
UI.RemoveElement(restartButton);
UI.RemoveElement(pausePanel);
UI.RemoveElement(scoreLabel);
UI.RemoveElement(logo);
score = 0;
Position = Scene.TileToGridLocation(spawnPoint);
health = 100;
Expand All @@ -139,11 +141,16 @@ public void makePauseMenu()
pausePanel.Anchor = UIAnchor.Center;
pausePanel.OnClick += restart;
scoreLabel = new Label();
scoreLabel.Text = "You have been defeated\nYou scored: " + score.ToString();
scoreLabel.Text = "You have been defeated\n You scored: " + score.ToString();
scoreLabel.Anchor = UIAnchor.Center;
scoreLabel.FontSize = 32;
scoreLabel.Colour = Color.Black;
scoreLabel.Offset = new Vector2(0, -70);
scoreLabel.Offset = new Vector2(0, -10);
logo = new Picture();
logo.Texture = AssetManager.AttemptLoad<Texture2D>("logo.png");
logo.Anchor = UIAnchor.Top;
logo.Offset = new Vector2(0, 90);
logo.Scale = 0.3f;
restartButton = new RectangleButton();
restartButton.OnClick += restart;
restartButton.Anchor = UIAnchor.Center;
Expand All @@ -157,6 +164,7 @@ public void makePauseMenu()
restartButton.Label = label;
UI.AddElement(pausePanel);
UI.AddElement(restartButton);
UI.AddElement(logo);
UI.AddElement(scoreLabel);
}

Expand Down Expand Up @@ -317,7 +325,7 @@ public override void Update(GameTime delta)
}

healthBar.Value = health / 100;
healthCount.Text = health.ToString() + " / " + 100;
healthCount.Text = (int)health + " / " + 100;
scoreCount.Text = "Score: " + score.ToString();
Scene.LookAt(calculateLookAt());
}
Expand Down

0 comments on commit ae7f359

Please sign in to comment.