From 35dae3cc1d3a76eeef18f625dda55a5e7fdfd079 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 19 Oct 2018 08:47:09 +0000 Subject: Small tweak to grav demo. --- xd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xd.c b/xd.c index ed6b6a9..e17461f 100644 --- a/xd.c +++ b/xd.c @@ -4083,7 +4083,7 @@ static void GravityDemo(void) gravobj[0].y = mouse_y; } - for(f = 1; f < GRAV_OBJ; f++) + for(f = 0; f < GRAV_OBJ; f++) { if (gravobj[f].alive) { @@ -4112,6 +4112,8 @@ static void GravityDemo(void) dx /= d; dy /= d; + g /= gravobj[f].mass; + dx *= g; dy *= g; -- cgit v1.2.3