Index: explosion.frag
===================================================================
--- explosion.frag	(revision db06984dd8b4a063db3a92fd593585c1fa2d7f26)
+++ explosion.frag	(revision adb104f668153b60965267a8c9589bbd74ce92d3)
@@ -5,8 +5,5 @@
 out vec4 frag_color;
 
-vec4 particle_color = vec4 (0.5, 0.5, 0.8, 0.8);
-
 void main() {
-   frag_color.a = opacity;
-   frag_color.rgb = particle_color.rgb;
+   frag_color = vec4(1.0, opacity * opacity, 0.0, opacity);
 }
Index: explosion.vert
===================================================================
--- explosion.vert	(revision db06984dd8b4a063db3a92fd593585c1fa2d7f26)
+++ explosion.vert	(revision adb104f668153b60965267a8c9589bbd74ce92d3)
@@ -1,5 +1,8 @@
 #version 410 core
 
-uniform float elapsed_system_time;
+// TODO: Pass the explosion center in as a uniform
+
+uniform float explosion_start_time;
+uniform float cur_time;
 
 layout (location = 0) in vec3 v_i; // initial velocity
@@ -9,12 +12,24 @@
 
 void main() {
-   float t = elapsed_system_time - start_time;
-   t = mod(t, 3.0); // allow time to loop around so particle emitter keeps going
+   float duration = 0.5;
+   float t = cur_time - explosion_start_time - start_time;
 
-   vec3 p = vec3(0.0, 0.0, 0.0);
-   vec3 a = vec3(0.0, -1.0, 0.0); // gravity
-   p += v_i * t + 0.5 * a * t * t;
+   if (t < 0.0) {
+      opacity = 0.0;
+   } else {
+      // Need to find out the last time this particle was at the origin
+      // If that is greater than the duration, hide the particle
+      float cur = floor(t / duration);
+      float end = floor((duration - start_time) / duration);
+      if (cur > end) {
+         opacity = 0.0;
+      } else {
+         opacity = 1.0 - (t / duration);
+      }
+   }
 
-   opacity = 1.0 - (t / 3.0);
+   vec3 p = vec3(0.0, 0.0, 0.0); //  this is the center of the explosion
+   vec3 a = vec3(0.0, 0.1, 0.0);
+   p += normalize(v_i) * mod(t, duration) / duration * 0.3; // allow time to loop around so particle emitter keeps going
 
    gl_Position = vec4(p, 1.0);
Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision db06984dd8b4a063db3a92fd593585c1fa2d7f26)
+++ new-game.cpp	(revision adb104f668153b60965267a8c9589bbd74ce92d3)
@@ -618,5 +618,6 @@
    GLuint laser_sp_models_ub_index = glGetUniformBlockIndex(laser_sp, "models");
 
-   GLuint elapsed_system_time_loc = glGetUniformLocation(explosion_sp, "elapsed_system_time");
+   GLuint explosion_start_time_loc = glGetUniformLocation(explosion_sp, "explosion_start_time");
+   GLuint cur_time_loc = glGetUniformLocation(explosion_sp, "cur_time");
 
 
@@ -820,4 +821,10 @@
                   removeObjectFromScene(*objects[i], ubo);
                   score++;
+
+                  // render an explosion
+                  glUseProgram(explosion_sp);
+                  glUniform1f(explosion_start_time_loc, (GLfloat)glfwGetTime());
+                  cout << "REMOVED" << endl;
+                  cout << i << endl;
                }
             }
@@ -915,5 +922,5 @@
 
       glUseProgram(explosion_sp);
-      glUniform1f(elapsed_system_time_loc, (GLfloat)current_seconds);
+      glUniform1f(cur_time_loc, (GLfloat)current_seconds);
 
       // Render scene
@@ -1907,9 +1914,9 @@
       t_accum += 0.01f;
 
-      float randx = ((float)rand() / (float)RAND_MAX) * 1.0f - 0.5f;
-      float randz = ((float)rand() / (float)RAND_MAX) * 1.0f - 0.5f;
+      float randx = ((float)rand() / (float)RAND_MAX) - 0.5f;
+      float randy = ((float)rand() / (float)RAND_MAX) - 0.5f;
       vv[i*3] = randx;
-      vv[i*3 + 1] = 1.0f;
-      vv[i*3 + 2] = randz;
+      vv[i*3 + 1] = randy;
+      vv[i*3 + 2] = 0.0f;
    }
 
