feat: initial bandit and more npc tweaks
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
#include "../player.h"
|
||||
#include <SDL3/SDL_keycode.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void PlayerUpdate(SDL_Event *event, Player *player)
|
||||
{
|
||||
SDL_KeyboardEvent key = event->key;
|
||||
if (key.key == SDLK_W)
|
||||
{
|
||||
switch(key.key) {
|
||||
case SDLK_W: {
|
||||
player->pos.y += 10;
|
||||
}
|
||||
if (key.key == SDLK_A)
|
||||
{
|
||||
}
|
||||
case SDLK_A: {
|
||||
player->pos.x -= 10;
|
||||
}
|
||||
if (key.key == SDLK_D)
|
||||
{
|
||||
}
|
||||
case SDLK_D: {
|
||||
player->pos.x += 10;
|
||||
}
|
||||
if (key.key == SDLK_S)
|
||||
{
|
||||
}
|
||||
case SDLK_S: {
|
||||
player->pos.y -= 10;
|
||||
}
|
||||
}
|
||||
printf("Player: %f %f\n", player->pos.x, player->pos.y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user