|
@@ -68,10 +68,11 @@ void application::update()
|
|
|
}
|
|
|
this->millisecsPreviousFrame = SDL_GetTicks();
|
|
|
|
|
|
+ this->part->acceleration = vec2(0.0, 9.8 * PIXELS_PER_METER);
|
|
|
|
|
|
- this->part->velocity = vec2(100 * deltaTime, 30 * deltaTime);
|
|
|
-
|
|
|
- this->part->position += (this->part->velocity);
|
|
|
+ // Integrate the change
|
|
|
+ this->part->velocity += (this->part->acceleration * deltaTime);
|
|
|
+ this->part->position += (this->part->velocity * deltaTime);
|
|
|
}
|
|
|
|
|
|
void application::render()
|