-
Notifications
You must be signed in to change notification settings - Fork 0
Adjust particle visuals #23
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
Conversation
…tion emitters and player exhaust. # Conflicts: # src/spaced/spaced/game/hud.cpp
# Conflicts: # src/spaced/spaced/scenes/game.cpp
56c43ae to
191b8a6
Compare
src/spaced/spaced/game/player.hpp
Outdated
| #include <spaced/game/controller.hpp> | ||
| #include <spaced/game/health.hpp> | ||
| #include <spaced/game/weapon.hpp> | ||
| #include <spaced/services/styles.hpp> |
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.
Move this include to the cpp file.
| StringMap<bave::Rgba> rgbas{}; | ||
| StringMap<ui::ButtonStyle> buttons{}; | ||
| StringMap<ui::ProgressBarStyle> progress_bars{}; | ||
| StringMap<ui::ProgressBarStyle> player{}; |
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.
Please remove this member.
src/spaced/spaced/scenes/game.cpp
Outdated
|
|
||
| auto const& rgbas = get_services().get<Styles>().rgbas; | ||
| auto spawn = [this] { | ||
| auto spawn = [this, rgbas] { |
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.
Don't copy rgbas by value in the lambda, take it by reference instead; we know that the Styles reference will outlive m_enemy_spawner (because it's a service indirectly owned by Spaced) so it's safe. [this, &rgbas]
src/spaced/spaced/scenes/game.cpp
Outdated
| auto spawn = [this, rgbas] { | ||
| auto ret = std::make_unique<Creep>(get_services(), this); | ||
| ret->shape.tint = bave::yellow_v; | ||
| ret->shape.tint = random_in_range(-1.f, 1.f) < 0.f ? rgbas["orange"] : rgbas["milk"]; |
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.
Why not random_in_range(0, 1) == 0? Floating point randomness is more computationally expensive, and you just want a binary range (this or that), not a theoretically infinite range of floats.
src/spaced/spaced/scenes/home.cpp
Outdated
| #include <spaced/services/layout.hpp> | ||
| #include <spaced/services/resources.hpp> | ||
| #include <spaced/services/scene_switcher.hpp> | ||
| #include <spaced/services/styles.hpp> |
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.
Unused header?
src/spaced/spaced/scenes/home.cpp
Outdated
| #include <spaced/util.hpp> | ||
|
|
||
| namespace spaced { | ||
| using bave::Rgba; |
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.
Unused alias?
src/spaced/spaced/scenes/home.cpp
Outdated
| void Home::on_loaded() { create_ui(); } | ||
|
|
||
| void Home::create_ui() { | ||
|
|
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.
Stray new line.
goddammit, pressed approve instead of request changes
karnkaul
left a comment
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.
Refer to comments from the previous (mistakenly approved and then dismissed) review for requested changes.
need help with line 106 in
player.cpp