Skip to content
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

Tuxs action updates regardless of whether Tux is being drawn. #2613

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,13 +1860,6 @@ Player::get_action() const
void
Player::draw(DrawingContext& context)
{
if (Editor::is_active()) {
return;
}

if (!m_visible)
return;

if (is_dead() && m_target && Sector::get().get_object_count<Player>([this](const Player& p){ return !p.is_dead() && !p.is_dying() && !p.is_winning() && &p != this; }))
{
auto* target = Sector::get().get_object_by_uid<Player>(*m_target);
Expand Down Expand Up @@ -2090,19 +2083,16 @@ Player::draw(DrawingContext& context)
*/

/* Draw Tux */
if (m_safe_timer.started() && size_t(g_game_time * 40) % 2)
if (m_safe_timer.started() && size_t(g_game_time * 40) % 2 || (Editor::is_active() || !m_visible))
tylerandari13 marked this conversation as resolved.
Show resolved Hide resolved
{
} // don't draw Tux

else if (m_player_status.bonus[get_id()] == EARTH_BONUS) {
else if (m_player_status.bonus[get_id()] == EARTH_BONUS)
m_sprite->draw(context.color(), get_pos(), LAYER_OBJECTS + 1);
tylerandari13 marked this conversation as resolved.
Show resolved Hide resolved
else if (m_dying)
m_sprite->draw(context.color(), get_pos(), Sector::get().get_foremost_layer());
else
m_sprite->draw(context.color(), get_pos(), LAYER_OBJECTS + 1);
}
else {
if (m_dying)
m_sprite->draw(context.color(), get_pos(), Sector::get().get_foremost_layer());
else
m_sprite->draw(context.color(), get_pos(), LAYER_OBJECTS + 1);
}

//TODO: Replace recoloring with proper costumes
Color power_color = (m_player_status.bonus[get_id()] == FIRE_BONUS ? Color(1.f, 0.7f, 0.5f) :
Expand All @@ -2112,7 +2102,6 @@ Player::draw(DrawingContext& context)
Color(1.f, 1.f, 1.f));

m_sprite->set_color(m_stone ? Color(1.f, 1.f, 1.f) : power_color);

}


Expand Down
Loading