Skip to content

Add Hud. #22

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

Merged
merged 2 commits into from
Mar 16, 2024
Merged

Add Hud. #22

merged 2 commits into from
Mar 16, 2024

Conversation

karnkaul
Copy link
Member

@karnkaul karnkaul commented Mar 15, 2024

  • Divide viewport into hud and game areas.

  • Add lavender hex for gun beam in styles.

  • Need to update bave to get a stable commit hash.

Close #5

@karnkaul karnkaul marked this pull request as ready for review March 15, 2024 06:14
@karnkaul karnkaul marked this pull request as draft March 15, 2024 06:14
@karnkaul karnkaul marked this pull request as ready for review March 15, 2024 08:15
@karnkaul karnkaul requested a review from swagween March 15, 2024 08:15
- Divide viewport into hud and game areas.
- Add lavender hex for gun beam in styles.
auto text = std::make_unique<ui::Text>(services);
m_score = text.get();
text->text.set_height(TextHeight{60});
text->text.set_string("9999999999");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this if you are just overwriting it on line 38?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the maximum width the score could possibly take, and create the background with a slightly larger width.

public:
explicit Hud(Services const& services);

void set_score(std::int64_t score);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the benefit of std::int64_t over, say uint64_t?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsigned integers don't behave like numbers and should be avoided.

https://hamstergene.github.io/posts/2021-10-30-do-not-use-unsigned-for-nonnegativity/

@karnkaul karnkaul merged commit 3709ad8 into main Mar 16, 2024
@karnkaul karnkaul deleted the karnage/hud branch March 16, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HUD
2 participants