summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-10-15 12:31:52 +0000
committerIan C <ianc@noddybox.co.uk>2018-10-15 12:31:52 +0000
commit2a2742343fa026025b64af4d495ec442ddddb8d2 (patch)
tree74d96e71370016c0c305d61b5614e8b8e5c50e4e
parente37fab07131b0eb377ff2b5d3bce8b4338d26a70 (diff)
Small tweak to grav demo.
-rw-r--r--xd.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/xd.c b/xd.c
index 2e54639..f2502e0 100644
--- a/xd.c
+++ b/xd.c
@@ -3950,15 +3950,8 @@ static void GravityDemo(void)
a = (a + 900) % 3600;
- gravobj[f].dx = sintab[a] * 10;
- gravobj[f].dy = costab[a] * 10;
-
- /*
- gravobj[f].x = RND(width);
- gravobj[f].y = RND(height);
- gravobj[f].dx = (double)RND(10)/10.0;
- gravobj[f].dy = (double)RND(10)/10.0;
- */
+ gravobj[f].dx = sintab[a] * 0.1;
+ gravobj[f].dy = costab[a] * 0.1;
gravobj[f].mass = 1;
}
@@ -4003,7 +3996,7 @@ static void GravityDemo(void)
g = 1.0 / d*d;
- g /= 100.0;
+ g /= 10000.0;
g *= gravobj[f].mass;
dx /= d;
@@ -4020,8 +4013,8 @@ static void GravityDemo(void)
for(f = 0; f < GRAV_OBJ; f++)
{
- gravobj[f].x += gravobj[f].dx / 50.0;
- gravobj[f].y += gravobj[f].dy / 50.0;
+ gravobj[f].x += gravobj[f].dx;
+ gravobj[f].y += gravobj[f].dy;
for(r = GRAV_TRAIL - 1; r > 0; r--)
{