diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-09-19 20:11:32 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-09-19 20:11:32 -0400 |
| commit | d439ed77546a00929ddd55bf44d65b448d9d520c (patch) | |
| tree | cf1070d32e766c0fe5d753aebee840f0be67756f /collision.c | |
| parent | 8944ad075c6b12bbda1273ec31efade801892c19 (diff) | |
| download | balls-d439ed77546a00929ddd55bf44d65b448d9d520c.zip | |
pretty good collisions
Diffstat (limited to 'collision.c')
| -rw-r--r-- | collision.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/collision.c b/collision.c index d377d39..334256e 100644 --- a/collision.c +++ b/collision.c @@ -5,8 +5,8 @@ iscollision(Point p, Point q) { int dx, dy; dx = p.x - q.x; - dy = p.y-q.y; - return (dx*dx + dy*dy) < 4*RADIUS*RADIUS; + dy = p.y - q.y; + return (dx*dx + dy*dy) <= 4*RADIUS*RADIUS; } /* TODO: remove |