From abb6d1780905e52dd6959211b9040de72c3306bd Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Tue, 14 Aug 2018 06:27:04 +0300 Subject: [PATCH] looks more fun when increasing the pull of gravity --- src/gamescr.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gamescr.cc b/src/gamescr.cc index abd7865..638032c 100644 --- a/src/gamescr.cc +++ b/src/gamescr.cc @@ -68,6 +68,9 @@ struct QuadMesh { #define CONTRIB_THRES 0.005 #define CONTRIB_RANGE(m) sqrt((m) / CONTRIB_THRES) +/* gravitational strength */ +#define GRAV_STR 16.0f + static int pos_to_grid(float x, float y); static Vec2 grid_to_pos(int gx, int gy); @@ -177,7 +180,7 @@ static void simstep() while(p) { // calculate the field gradient at the particle position int gidx = pos_to_grid(p->pos.x, p->pos.y); - Vec2 grad = calc_field_grad(gidx); + Vec2 grad = calc_field_grad(gidx) * GRAV_STR; p->vel += grad * SIM_DT; p->pos += p->vel * SIM_DT; @@ -291,7 +294,7 @@ static void update() em->pos = emit_place_pos; em->mass = 100; em->rate = 10; - em->chunk = 0.01 * em->mass; + em->chunk = 0.001 * em->mass; em->angle = -1; em->spread = 0; em->spawn_pending = 0; -- 1.7.10.4