diff --git a/src/main.cpp b/src/main.cpp index 606a442..e35a58a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "phys_obj.h" SDL_Window *win = NULL; @@ -51,7 +52,7 @@ bool clamp(float *value, float val) { } void gravity(phys_obj &obj) { - obj.velocity = Vector(0,obj.velocity.y--); + obj.velocity = Vector(0,obj.velocity.y++); } int main() { @@ -178,10 +179,10 @@ int main() { rect.render(rend); } for(int i=0; i= h)) { + if(!(objs[i].bounds.max.y >= h)) { gravity(objs[i]); } - objs[0].render(rend); + objs[i].render(rend); } if(change_vector[0]) { if(buffer.x != 0.0) {