Minor refactoring
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 26s

This commit is contained in:
Stephen Seo 2023-08-31 15:34:58 +09:00
parent 3c944d6f8e
commit c14123b3d0
3 changed files with 6 additions and 1 deletions

View file

@ -39,3 +39,7 @@ void set_color_from_neon_color(NeonColor nc, Color *c_out) {
break;
}
}
void set_color_from_neon_random(Color *c_out) {
set_color_from_neon_color(get_random_neon_color(), c_out);
}

View file

@ -22,5 +22,6 @@ enum class NeonColor {
extern NeonColor get_random_neon_color();
extern void set_color_from_neon_color(NeonColor nc, Color *c_out);
extern void set_color_from_neon_random(Color *c_out);
#endif

View file

@ -109,7 +109,7 @@ bool TRunnerScreen::update(float dt, bool is_resized) {
if (walker_hack_success && controlled_walker_idx.has_value()) {
walkers[controlled_walker_idx.value()].set_player_controlled(true);
Color color;
set_color_from_neon_color(get_random_neon_color(), &color);
set_color_from_neon_random(&color);
electricityEffects.push_back(ElectricityEffect(
walkers[controlled_walker_idx.value()].get_body_pos(),
ELECTRICITY_EFFECT_RADIUS, ELECTRICITY_EFFECT_LINE_COUNT,