aboutsummaryrefslogtreecommitdiff
path: root/src/engine/entity.c
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2023-04-06 21:35:17 +0200
committerGitHub <noreply@github.com>2023-04-06 21:35:17 +0200
commitb2c58b8d52717f8b5bf04d87b9799c7467e4eeb6 (patch)
tree344243247b21a93311a9cc2173fbddb2d126c040 /src/engine/entity.c
parent8be7919774250cca23151bf1505cbb48d1dd45ee (diff)
parente88c48ae60dd48542e44b0cc244b191c91782681 (diff)
Merge pull request #60 from UnavailableDev/dev
random shop items + animation (slimes)
Diffstat (limited to 'src/engine/entity.c')
-rw-r--r--src/engine/entity.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/engine/entity.c b/src/engine/entity.c
index eba6481..4bf1b60 100644
--- a/src/engine/entity.c
+++ b/src/engine/entity.c
@@ -173,7 +173,9 @@ void hh_jump_entity(hh_entity* object_1){
}
void hh_gravity_entity(hh_entity* object_1){
if (object_1->is_grounded == false) {
- object_1->vel.y += 1; //gravity
+ if(object_1->vel.y < 15) {
+ object_1->vel.y += 1; //gravity
+ }
}
}
@@ -181,6 +183,7 @@ void hh_movement_entity(hh_entity* object_1, int8_t* direction){
if(direction != 0){
if(object_1->vel.x > -1 * object_1->speed && object_1->vel.x < object_1->speed) {
object_1->vel.x = object_1->vel.x + direction;
+ object_1->render.fam.horizontal_flip=(object_1->vel.x>0?0:1);// flips direction of object_1
} else {
if (object_1->vel.x > 0) {
object_1->vel.x--;