unnamed-platformer/src/player.c

31 lines
479 B
C
Raw Normal View History

#include <gint/keyboard.h>
void jump_test(char *jump_pressed, char *jump_buffer, unsigned int *jump_hold)
{
if (keydown(KEY_SHIFT))
{
if (!*jump_pressed)
{
*jump_pressed = 1;
*jump_buffer = 3;
}
}
else {
*jump_hold = 0;
*jump_pressed = 0;
}
if (*jump_buffer) *jump_buffer -= 1;
}
void set_start_pos(int *start_x, int *start_y, int x, int y)
{
*start_x = x;
*start_y = y;
}
void reset_old_pos(int *old_x, int *old_y)
{
2020-02-15 12:34:57 +01:00
*old_x = -16;
*old_y = -16;
}