From: John Tsiombikas Date: Tue, 14 Aug 2018 03:27:04 +0000 (+0300) Subject: looks more fun when increasing the pull of gravity X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=ld42_outofspace;a=commitdiff_plain;h=abb6d1780905e52dd6959211b9040de72c3306bd looks more fun when increasing the pull of gravity --- 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;