Fix crates hitbox collision with player
parent
e8ebe0f89c
commit
e6784a4d71
|
@ -37,10 +37,14 @@ int main(void)
|
|||
init_memory_pools();
|
||||
|
||||
init_assets(&engine.assets);
|
||||
//load_from_infofile("res/assets.info.raw", &engine.assets);
|
||||
//init_player_creation("res/player_spr.info", &engine.assets);
|
||||
|
||||
#ifndef NDEBUG
|
||||
load_from_infofile("res/assets.info.raw", &engine.assets);
|
||||
init_player_creation("res/player_spr.info", &engine.assets);
|
||||
#else
|
||||
load_from_rres("res/myresources.rres", &engine.assets);
|
||||
init_player_creation_rres("res/myresources.rres", "player_spr.info", &engine.assets);
|
||||
#endif
|
||||
init_item_creation(&engine.assets);
|
||||
|
||||
LevelScene_t scene;
|
||||
|
|
|
@ -1485,7 +1485,7 @@ void hitbox_update_system(Scene_t* scene)
|
|||
p_pstate != NULL
|
||||
)
|
||||
{
|
||||
if (p_ctransform->position.y + p_bbox->size.y <= p_other_ct->position.y + p_other_bbox->half_size.y / 2)
|
||||
if (p_ctransform->position.y + p_bbox->size.y <= p_other_ct->position.y)
|
||||
{
|
||||
p_ctransform->velocity.y = -400;
|
||||
if (p_pstate->jump_pressed)
|
||||
|
@ -1496,7 +1496,7 @@ void hitbox_update_system(Scene_t* scene)
|
|||
p_cjump->jumped = true;
|
||||
}
|
||||
}
|
||||
else if (p_ctransform->position.y > p_other_ct->position.y + p_other_bbox->half_size.y * 1.5)
|
||||
else if (p_ctransform->position.y >= p_other_ct->position.y + p_other_bbox->size.y)
|
||||
{
|
||||
p_ctransform->velocity.y = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue