This commit is contained in:
@@ -7,19 +7,19 @@
|
|||||||
void checkCollision(){
|
void checkCollision(){
|
||||||
for(int u=0; u<=MAX_ENTITIES; u++){
|
for(int u=0; u<=MAX_ENTITIES; u++){
|
||||||
Entity *en1 = &entities[u];
|
Entity *en1 = &entities[u];
|
||||||
for(int j=0; u<=MAX_ENTITIES; u++){
|
for(int j=0; j<=MAX_ENTITIES; j++){
|
||||||
if(u!=j){
|
if(u!=j){
|
||||||
Entity *en2 = &entities[j];
|
Entity *en2 = &entities[j];
|
||||||
if(en1->position.x<en2->position.x){
|
//if(en1->position.x>en2->position.x){
|
||||||
ApplyForce(
|
ApplyForce(
|
||||||
en1,
|
en1,
|
||||||
(Vector2){10000, 0}
|
(Vector2){100000, 0}
|
||||||
);
|
);
|
||||||
ApplyForce(
|
ApplyForce(
|
||||||
en2,
|
en2,
|
||||||
(Vector2){-10000, 0}
|
(Vector2){-100000, 0}
|
||||||
);
|
);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user