changed jump speed and reordered collision shape points for player

This commit is contained in:
Sara 2023-10-25 23:25:23 +02:00
parent 77c266b43f
commit d52ae5fe45

View file

@ -41,10 +41,10 @@ void player_start(Player* self) {
.transform = {ZeroVector, {4, 4}, 0},
.sprite = sprite_from_spritesheet(spr_player_standing, 0),
.shape = shape_new((Vector[]){
{ex_w, -rr}, {ex_w-r, 0.f},
{r-ex_w, 0.f}, {-ex_w, -rr},
{-ex_w, rr-h}, {r-ex_w, -h},
{ex_w-r, -h}, {ex_w, rr-h},
{ex_w, -rr}, {ex_w-r, 0.f},
}, 8)
};
self->rigidbody = rigidbody_make(Player_as_Transformable(self));
@ -59,7 +59,7 @@ void player_update(Player* self, float dt) {
Vector velocity_target = {self->is_grounded ? _directional.x : velocity.x, velocity.y};
if(_directional.y < 0 && self->is_grounded) {
_directional.y = 0;
velocity.y = -20.f;
velocity.y = -30.f;
rigidbody_set_velocity(self->rigidbody, velocity);
}
rigidbody_accelerate(self->rigidbody, vmulff(vsubf(velocity_target, velocity), 50.f), 0);