mirror of
https://git.sr.ht/~kikoodx/momento
synced 2024-06-07 19:20:22 +02:00
15 lines
358 B
C
15 lines
358 B
C
|
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
||
|
/* Copyright (C) 2021 KikooDX */
|
||
|
|
||
|
#include "player.h"
|
||
|
#include <gint/keyboard.h>
|
||
|
|
||
|
void player_update(struct Player *player)
|
||
|
{
|
||
|
/* process input */
|
||
|
const int move_x = keydown(KEY_RIGHT) - keydown(KEY_LEFT);
|
||
|
const int move_y = keydown(KEY_DOWN) - keydown(KEY_UP);
|
||
|
player->x += move_x;
|
||
|
player->y += move_y;
|
||
|
}
|