blob: f2b5a8ed93a3756aeab57e85dbf6d9e0811ec406 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "player.h"
void
drawPlayer(Player *player)
{
//DrawCube(player->position, 1.0f, 1.0f, 1.0f, BLUE);
DrawSphereEx(player->position, 0.5f, 3, 3, player->color);
}
void
movePlayer(Player *player)
{
player->direction.x = inputs_p1.stick_x / 126.0f;
player->direction.z = -inputs_p1.stick_y / 126.0f;
player->position.x += player->direction.x * player->speed;
player->position.y += player->direction.y * player->speed;
player->position.z += player->direction.z * player->speed;
}
|