- {
- if (size == SMALL)
- {
- if (invincible_timer.started())
- {
- if (dir == RIGHT)
- cape_right[global_frame_counter % 2]->draw(base.x- scroll_x, base.y);
- else
- cape_left[global_frame_counter % 2]->draw(base.x- scroll_x, base.y);
- }
-
- if (!skidding_timer.started())
- {
- if (physic.get_velocity_y() != 0)
- {
- if (dir == RIGHT)
- smalltux_jump_right->draw( base.x - scroll_x, base.y - 10);
- else
- smalltux_jump_left->draw( base.x - scroll_x, base.y - 10);
- }
- else
- {
- if (fabsf(physic.get_velocity_x()) < 1.0f) // standing
- {
- if (dir == RIGHT)
- smalltux_stand_right->draw( base.x - scroll_x, base.y - 9);
- else
- smalltux_stand_left->draw( base.x - scroll_x, base.y - 9);
- }
- else // moving
- {
- if (dir == RIGHT)
- tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9);
- else
- tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9);
- }
- }
- }
- else
- {
- if (dir == RIGHT)
- smalltux_skid_right->draw(base.x - scroll_x, base.y);
- else
- smalltux_skid_left->draw(base.x - scroll_x, base.y);
- }
-
- if (holding_something && physic.get_velocity_y() == 0)
- {
- if (dir == RIGHT)
- smalltux_grab_right->draw(base.x - scroll_x, base.y);
- else
- smalltux_grab_left->draw(base.x - scroll_x, base.y);
- }
- }
- else // Large Tux
- {
- if (invincible_timer.started())
- {
- float capex = base.x + (base.width - bigcape_right[0]->w) / 2;
- capex -= scroll_x;
- float capey = base.y + (base.height - bigcape_right[0]->h) / 2;
-
- /* Draw cape (just not in ducked mode since that looks silly): */
- if (dir == RIGHT)
- bigcape_right[global_frame_counter % 2]->draw(capex, capey);
- else
- bigcape_left[global_frame_counter % 2]->draw(capex, capey);
- }
-
- if (!got_coffee)
- {
- if (!duck)
- {
- if (!skidding_timer.started())
- {
- if (physic.get_velocity_y() == 0)
- {
- if (fabsf(physic.get_velocity_x()) < 1.0f) // standing
- {
- if (dir == RIGHT)
- largetux_stand_right->draw(base.x - scroll_x, base.y);
- else
- largetux_stand_left->draw(base.x - scroll_x, base.y);
- }
- else // walking
- {
- if (dir == RIGHT)
- bigtux_right->draw(base.x - scroll_x, base.y);
- else
- bigtux_left->draw(base.x - scroll_x, base.y);
- }
- }
- else
- {
- if (dir == RIGHT)
- bigtux_right_jump->draw(base.x - scroll_x, base.y);
- else
- bigtux_left_jump->draw(base.x - scroll_x, base.y);
- }
- }
- else
- {
- if (dir == RIGHT)
- skidtux_right->draw(base.x - scroll_x - 8, base.y);
- else
- skidtux_left->draw(base.x - scroll_x - 8, base.y);
- }
- }
- else
- {
- if (dir == RIGHT)
- ducktux_right->draw(base.x - scroll_x, base.y);
- else
- ducktux_left->draw(base.x - scroll_x, base.y);
- }
- }
- else
- {
- /* Tux has coffee! */
- if (!duck)
- {
- if (!skidding_timer.started())
- {
- if (!jumping || physic.get_velocity_y() > 0)
- {
- if (dir == RIGHT)
- bigfiretux_right[frame_]->draw(base.x- scroll_x - 8, base.y);
- else
- bigfiretux_left[frame_]->draw(base.x- scroll_x - 8, base.y);
- }
- else
- {
- if (dir == RIGHT)
- bigfiretux_right_jump->draw(base.x- scroll_x - 8, base.y);
- else
- bigfiretux_left_jump->draw(base.x- scroll_x - 8, base.y);
- }
- }
- else
- {
- if (dir == RIGHT)
- skidfiretux_right->draw(base.x- scroll_x - 8, base.y);
- else
- skidfiretux_left->draw(base.x- scroll_x - 8, base.y);
- }
- }
- else
- {
- if (dir == RIGHT)
- duckfiretux_right->draw( base.x- scroll_x - 8, base.y - 16);
- else
- duckfiretux_left->draw( base.x- scroll_x - 8, base.y - 16);
- }
- }
-
- if (holding_something && !duck && physic.get_velocity_y() == 0)
- {
- if (dir == RIGHT)
- largetux_grab_right->draw(base.x - scroll_x, base.y);
- else
- largetux_grab_left->draw(base.x - scroll_x, base.y);
- }
- }
- }