2021-03-28 23:44:24 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
/* Copyright (C) 2021 KikooDX */
|
|
|
|
|
2021-04-03 23:49:14 +02:00
|
|
|
#include "conf.h"
|
2021-04-04 17:33:17 +02:00
|
|
|
#include "level.h"
|
2021-03-28 23:44:24 +02:00
|
|
|
#include "player.h"
|
|
|
|
#include <gint/display.h>
|
2021-04-07 11:45:47 +02:00
|
|
|
#include <libimg.h>
|
2021-03-28 23:44:24 +02:00
|
|
|
|
2021-04-04 17:33:17 +02:00
|
|
|
extern struct Level level;
|
|
|
|
|
2021-04-07 11:45:47 +02:00
|
|
|
extern img_t const img_player;
|
|
|
|
extern bopti_image_t const bimg_burst;
|
2021-03-28 23:44:24 +02:00
|
|
|
|
|
|
|
void player_draw(struct Player player)
|
|
|
|
{
|
2021-04-07 11:45:47 +02:00
|
|
|
img_render_vram(img_player, player.x, player.y);
|
2021-04-03 23:49:14 +02:00
|
|
|
if (player.air_state == AirRising &&
|
|
|
|
player.jumps_left < AIR_JUMPS)
|
|
|
|
dimage(player.x, player.y + PLAYER_HEIGHT, &bimg_burst);
|
2021-04-04 17:33:17 +02:00
|
|
|
dprint(2, 2, C_WHITE, "%d", level.gold);
|
2021-03-28 23:44:24 +02:00
|
|
|
}
|