int jump_count;
color_t color;
- /* TODO(#110): introduce checkpoints */
vec_t checkpoint;
int play_die_cue;
RETURN_LT0(player->lt);
}
+solid_ref_t player_as_solid(player_t *player)
+{
+ solid_ref_t ref = {
+ .tag = SOLID_PLAYER,
+ .ptr = (void*) player
+ };
+
+ return ref;
+}
+
int player_render(const player_t * player,
const camera_t *camera)
{
}
}
-void player_collide_with_platforms(player_t * player,
- const platforms_t *platforms)
-{
- if (player->state == PLAYER_STATE_ALIVE) {
- rigid_rect_collide_with_platforms(player->alive_body, platforms);
-
- if (rigid_rect_touches_ground(player->alive_body)) {
- player->jump_count = 0;
- }
- }
-}
-
-void player_collide_with_boxes(player_t * player,
- const boxes_t * boxes)
-{
- if (player->state == PLAYER_STATE_ALIVE) {
- rigid_rect_collide_with_boxes(player->alive_body, boxes);
-
- if (rigid_rect_touches_ground(player->alive_body)) {
- player->jump_count = 0;
- }
- }
-}
-
void player_impact_rigid_rect(player_t * player,
rigid_rect_t *rigid_rect)
{
return rect(0.0f, 0.0f, 0.0f, 0.0f);
}
}
+
+void player_rect_object_collide(player_t *player,
+ rect_t object,
+ int sides[RECT_SIDE_N])
+{
+ if (player->state == PLAYER_STATE_ALIVE) {
+ rigid_body_object_collide(player->alive_body, object, sides);
+ }
+}