static Particle *alloc_particle();
void free_particle(Particle *p);
+static bool pause;
+
static float grid[GRID_SIZE * GRID_SIZE];
static Particle *grid_part[GRID_SIZE * GRID_SIZE];
static Texture *grid_tex;
static Mesh *pmesh;
static unsigned int particle_sdr;
+static Vec2 cam_pos;
static float cam_theta;
static float cam_dist = 100.0f;
-static Vec2 *targ_pos;
+static Vec2 *targ_pos = &cam_pos;
static Mat4 view_matrix, proj_matrix;
static bool wireframe;
static void simstep()
{
+ if(pause) return;
+
// move existing particles
Particle *p = plist;
while(p) {
wireframe = !wireframe;
break;
+ case ' ':
+ pause = !pause;
+ break;
+
default:
break;
}
prev_x = x;
prev_y = y;
+ if(game_bnstate(0)) {
+ float pan_speed = pow(cam_dist, 1.5) * 0.00035; // magic
+ Vec2 dir = rotate(Vec2(dx, dy) * pan_speed, deg_to_rad(cam_theta));
+ cam_pos.x -= dir.x;
+ cam_pos.y -= dir.y;
+ }
+
if(game_bnstate(2)) {
cam_theta += dx * 0.5;
}