Browse Source

Fixed a bug in the 2d camera platformer example (#2687)

canJump used to alternate between true and false when on ground
skylar 3 years ago
parent
commit
ee5a87826d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/core/core_2d_camera_platformer.c

+ 1 - 1
examples/core/core_2d_camera_platformer.c

@@ -177,7 +177,7 @@ void UpdatePlayer(Player *player, EnvItem *envItems, int envItemsLength, float d
             ei->rect.x <= p->x &&
             ei->rect.x + ei->rect.width >= p->x &&
             ei->rect.y >= p->y &&
-            ei->rect.y < p->y + player->speed*delta)
+            ei->rect.y <= p->y + player->speed*delta)
         {
             hitObstacle = 1;
             player->speed = 0.0f;