more
Some checks failed
Build Project / build (push) Failing after 23m56s

This commit is contained in:
swim67667
2026-06-24 01:30:18 -04:00
parent 78597f14c0
commit 466d62c023
2 changed files with 8 additions and 6 deletions

View File

@@ -5,21 +5,23 @@
#include "player.h" #include "player.h"
void checkCollision(){ void checkCollision(){
for(int u=0; u<=MAX_ENTITIES; u++){ for(int u=0; u<=MAX_ENTITIES-1; u++){
Entity *en1 = &entities[u]; Entity *en1 = &entities[u];
for(int j=0; j<=MAX_ENTITIES; j++){ for(int j=1; j<=MAX_ENTITIES-1; j++){
if(u!=j){ if(u!=j){
Entity *en2 = &entities[j]; Entity *en2 = &entities[j];
//if(en1->position.x>en2->position.x){ if (fabsf(en1->position.x - en2->position.x) < (en1->size * 0.5f + en2->size * 0.5f))
{
ApplyForce( ApplyForce(
en1, en1,
(Vector2){100000, 0} (Vector2){10000, 0}
); );
ApplyForce( ApplyForce(
en2, en2,
(Vector2){-100000, 0} (Vector2){-10000, 0}
); );
//} }
if(fabsf(en1->position.y - en2->position.y) < (en1->size * 0.5f + en2->size * 0.5f))
} }
} }
} }

BIN
wrldbox

Binary file not shown.