collision/more physics updates
All checks were successful
Build Project / build (ubuntu-latest) (push) Successful in 17m55s
All checks were successful
Build Project / build (ubuntu-latest) (push) Successful in 17m55s
This commit is contained in:
14
src/world.c
14
src/world.c
@@ -1,5 +1,6 @@
|
||||
#include <stddef.h>
|
||||
#include "world.h"
|
||||
#include "collision.h"
|
||||
|
||||
// the beeg one. hooooooooooooooooh boy
|
||||
|
||||
@@ -39,12 +40,12 @@ bool IsGrounded(Entity *e)
|
||||
{
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
return (
|
||||
e->position.y +
|
||||
e->size * 0.5f >=
|
||||
ground_y - 2.0f
|
||||
);
|
||||
if(e->position.y +e->size * 0.5f >=ground_y - 2.0f || e->headgrounded){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Entity *SpawnEntity(
|
||||
@@ -76,6 +77,7 @@ Entity *SpawnEntity(
|
||||
e->force = (Vector2){0, 0};
|
||||
|
||||
e->color = color;
|
||||
e->headgrounded = false;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user