Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9d4e50d
)
pixels push rocks with their difference in speed, not their absolute velocity
author
Jason Woofenden
<jason183@herkamire.com>
Mon, 2 Apr 2007 22:44:12 +0000
(18:44 -0400)
committer
Jason Woofenden
<jason183@herkamire.com>
Mon, 2 Apr 2007 22:44:12 +0000
(18:44 -0400)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
c90a793
..
1bb6bc1
100644
(file)
--- 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);
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);
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;
}
}
}
}
}
}