aboutsummaryrefslogtreecommitdiff
path: root/src/entity.c
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-08-18 00:18:53 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-08-18 00:18:53 -0600
commitf98e6d4ea4ee52b298a7d9a9731da4c020bb4dfe (patch)
treefdb76e94e4d00cbe2ab652a9f65d6afaad779552 /src/entity.c
parent87b86d92c27a6fb83d0d09365a36d8a98ba0b24b (diff)
Some aim thingy
Diffstat (limited to 'src/entity.c')
-rw-r--r--src/entity.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/entity.c b/src/entity.c
index bb874df..52d24f6 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -1,5 +1,6 @@
#include "entity.h"
#include "entitiesInclude.h"
+#include <raylib.h>
// This fucker is used for creating entities.
const EntityTypeInfo entityTypeInfo[ENTITY_TYPE_COUNT] = {
@@ -375,15 +376,10 @@ void entityDraw(Entity * entity) {
}
void entityUpdatePosition(Entity * entity) {
- float t = GetFrameTime();
-
- Vector3 velocity = (Vector3){
- entity->velocity.velocity.x * t,
- entity->velocity.velocity.y * t,
- entity->velocity.velocity.z * t
- };
-
- entity->position = Vector3Add(entity->position, velocity);
+ entity->position = Vector3Add(
+ entity->position,
+ Vector3Scale(entity->velocity.velocity, GetFrameTime())
+ );
}
void entityUpdateRotation(Entity * entity) {