Changeset 2b0214c in opengl-game


Ignore:
Timestamp:
Oct 5, 2018, 1:07:44 AM (6 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
0e0f851
Parents:
1f3d32b
Message:

-Comment out the code for showing selected objects in a different color
-Increase the damage lasers deal to asteroids
-Remove asteroids from the scene when they're destroyed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-game.cpp

    r1f3d32b r2b0214c  
    458458   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
    459459
     460   // Comment these two lines out when I want to use selected colors
     461   glBindBuffer(GL_ARRAY_BUFFER, colors_vbo);
     462   glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);
     463
    460464   glBindBuffer(GL_ARRAY_BUFFER, normals_vbo);
    461465   glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, 0);
     
    734738
    735739               if ((obj_center.z - objects[i]->bounding_radius) > -NEAR_CLIP) {
     740                  removeObjectFromScene(*objects[i], ubo);
     741               }
     742               if (((Asteroid*)objects[i])->hp <= 0) {
    736743                  removeObjectFromScene(*objects[i], ubo);
    737744               }
     
    19511958
    19521959      if (closestAsteroid != NULL) {
    1953          eot = new EffectOverTime(closestAsteroid->hp, -5, closestAsteroid);
     1960         eot = new EffectOverTime(closestAsteroid->hp, -10, closestAsteroid);
    19541961         effects.push_back(eot);
    19551962      }
     
    20362043   glBindVertexArray(color_vao);
    20372044
     2045   /*
    20382046   if (selectedObject != NULL) {
    20392047      glBindBuffer(GL_ARRAY_BUFFER, selected_colors_vbo);
     
    20422050      glDrawArrays(GL_TRIANGLES, selectedObject->vertex_vbo_offset, selectedObject->num_points);
    20432051   }
    2044 
    2045    glBindBuffer(GL_ARRAY_BUFFER, colors_vbo);
    2046    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);
     2052   */
     2053
     2054   // Uncomment this code when I want to use selected colors again
     2055   // glBindBuffer(GL_ARRAY_BUFFER, colors_vbo);
     2056   // glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);
    20472057
    20482058   glDrawArrays(GL_TRIANGLES, shaderBufferInfo[color_sp].vbo_base, shaderBufferInfo[color_sp].vbo_offset);
Note: See TracChangeset for help on using the changeset viewer.