changed jump speed and reordered collision shape points for player
This commit is contained in:
parent
77c266b43f
commit
d52ae5fe45
|
@ -41,10 +41,10 @@ void player_start(Player* self) {
|
||||||
.transform = {ZeroVector, {4, 4}, 0},
|
.transform = {ZeroVector, {4, 4}, 0},
|
||||||
.sprite = sprite_from_spritesheet(spr_player_standing, 0),
|
.sprite = sprite_from_spritesheet(spr_player_standing, 0),
|
||||||
.shape = shape_new((Vector[]){
|
.shape = shape_new((Vector[]){
|
||||||
|
{ex_w, -rr}, {ex_w-r, 0.f},
|
||||||
{r-ex_w, 0.f}, {-ex_w, -rr},
|
{r-ex_w, 0.f}, {-ex_w, -rr},
|
||||||
{-ex_w, rr-h}, {r-ex_w, -h},
|
{-ex_w, rr-h}, {r-ex_w, -h},
|
||||||
{ex_w-r, -h}, {ex_w, rr-h},
|
{ex_w-r, -h}, {ex_w, rr-h},
|
||||||
{ex_w, -rr}, {ex_w-r, 0.f},
|
|
||||||
}, 8)
|
}, 8)
|
||||||
};
|
};
|
||||||
self->rigidbody = rigidbody_make(Player_as_Transformable(self));
|
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};
|
Vector velocity_target = {self->is_grounded ? _directional.x : velocity.x, velocity.y};
|
||||||
if(_directional.y < 0 && self->is_grounded) {
|
if(_directional.y < 0 && self->is_grounded) {
|
||||||
_directional.y = 0;
|
_directional.y = 0;
|
||||||
velocity.y = -20.f;
|
velocity.y = -30.f;
|
||||||
rigidbody_set_velocity(self->rigidbody, velocity);
|
rigidbody_set_velocity(self->rigidbody, velocity);
|
||||||
}
|
}
|
||||||
rigidbody_accelerate(self->rigidbody, vmulff(vsubf(velocity_target, velocity), 50.f), 0);
|
rigidbody_accelerate(self->rigidbody, vmulff(vsubf(velocity_target, velocity), 50.f), 0);
|
||||||
|
|
Loading…
Reference in a new issue