aboutsummaryrefslogtreecommitdiff
path: root/src/engine/entity.c
diff options
context:
space:
mode:
authorUnavailableDev <ggwildplay@gmail.com>2023-04-06 21:36:24 +0200
committerUnavailableDev <ggwildplay@gmail.com>2023-04-06 21:36:24 +0200
commite88c48ae60dd48542e44b0cc244b191c91782681 (patch)
tree344243247b21a93311a9cc2173fbddb2d126c040 /src/engine/entity.c
parent03748610041bcc8ec7a7743e9a5fb35c06731fa0 (diff)
random shop items + animations
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--;