From 941aee9daf4b4cfb337fbf9688876e86c3b0b001 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Mon, 2 Apr 2007 18:44:12 -0400 Subject: [PATCH] pixels push rocks with their difference in speed, not their absolute velocity --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index c90a793..1bb6bc1 100644 --- a/main.c +++ b/main.c @@ -270,11 +270,11 @@ move_dot(struct dot *d) d->active = 0; else { hit = pixel_collides(d->x, d->y); - if(hit && hit->type != SHIP) { + if(hit) if(hit->type != SHIP) { d->active = 0; mass = sprite_mass(hit); - hit->dx += DOT_MASS_UNIT * d->mass * d->dx / mass; - hit->dy += DOT_MASS_UNIT * d->mass * d->dy / mass; + hit->dx += DOT_MASS_UNIT * d->mass * (d->dx - hit->dx) / mass; + hit->dy += DOT_MASS_UNIT * d->mass * (d->dy - hit->dy) / mass; } } } -- 1.7.10.4