- void player_draw(player_type* pplayer)
- {
- if (!timer_started(&pplayer->safe_timer) || (frame % 2) == 0)
- {
- if (pplayer->size == SMALL)
- {
- if (timer_started(&pplayer->invincible_timer))
- {
- /* Draw cape: */
-
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&cape_right[frame % 2],
- pplayer->base.x- scroll_x, pplayer->base.y,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&cape_left[frame % 2],
- pplayer->base.x- scroll_x, pplayer->base.y,
- NO_UPDATE);
- }
- }
-
-
- if (!pplayer->got_coffee)
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&tux_right[pplayer->frame], pplayer->base.x- scroll_x, pplayer->base.y, NO_UPDATE);
- }
- else
- {
- texture_draw(&tux_left[pplayer->frame], pplayer->base.x- scroll_x, pplayer->base.y, NO_UPDATE);
- }
- }
- else
- {
- /* Tux got coffee! */
-
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&firetux_right[pplayer->frame], pplayer->base.x- scroll_x, pplayer->base.y, NO_UPDATE);
- }
- else
- {
- texture_draw(&firetux_left[pplayer->frame], pplayer->base.x- scroll_x, pplayer->base.y, NO_UPDATE);
- }
- }
- }
- else
- {
- if (timer_started(&pplayer->invincible_timer))
- {
- /* Draw cape: */
-
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&bigcape_right[frame % 2],
- pplayer->base.x- scroll_x - 8 - 16, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&bigcape_left[frame % 2],
- pplayer->base.x-scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
-
- if (!pplayer->got_coffee)
- {
- if (!pplayer->duck)
- {
- if (!timer_started(&pplayer->skidding_timer))
- {
- if (!pplayer->jumping || pplayer->base.ym > 0)
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&bigtux_right[pplayer->frame],
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&bigtux_left[pplayer->frame],
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&bigtux_right_jump,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&bigtux_left_jump,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&skidtux_right,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&skidtux_left,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&ducktux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&ducktux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16,
- NO_UPDATE);
- }
- }
- }
- else
- {
- /* Tux has coffee! */
-
- if (!pplayer->duck)
- {
- if (!timer_started(&pplayer->skidding_timer))
- {
- if (!pplayer->jumping || pplayer->base.ym > 0)
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&bigfiretux_right[pplayer->frame],
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&bigfiretux_left[pplayer->frame],
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&bigfiretux_right_jump,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&bigfiretux_left_jump,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&skidfiretux_right,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&skidfiretux_left,
- pplayer->base.x- scroll_x - 8, pplayer->base.y - 32,
- NO_UPDATE);
- }
- }
- }
- else
- {
- if (pplayer->dir == RIGHT)
- {
- texture_draw(&duckfiretux_right, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16,
- NO_UPDATE);
- }
- else
- {
- texture_draw(&duckfiretux_left, pplayer->base.x- scroll_x - 8, pplayer->base.y - 16,
- NO_UPDATE);
- }
- }
- }
- }
- }
- }