aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom White <weiss@simba.(none)>2008-08-14 23:19:18 +0100
committerTom White <weiss@simba.(none)>2008-08-14 23:19:18 +0100
commit8d29dac769a5826adbca0915ddc76758e7f8b7ae (patch)
tree6478702b348478e5d70c17c8d3a4759936fc34a2
parent2e245bad009a6c3a0aa8f206d1d1f16f40d30003 (diff)
Make fuel usage and charging independent of frame rate
-rw-r--r--src/physics.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/physics.c b/src/physics.c
index 4497a30..7416e64 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -418,7 +418,7 @@ void physics_step(Game *game, int dt) {
if ( game->thrusting ) {
if ( game->fuel > 0.0 ) {
game->lander->vz += THRUST * dt;
- game->fuel -= 0.0002;
+ game->fuel -= 0.00002 * dt;
game->lander->landed = 0;
game->radiation = 0.1;
if ( game->lander->recharging ) {
@@ -428,10 +428,10 @@ void physics_step(Game *game, int dt) {
}
}
if ( (game->radiation > 0.3) && (game->fuel > 0.0) ) {
- game->fuel -= 0.01*game->radiation;
+ game->fuel -= 0.001*game->radiation*dt;
}
if ( game->lander->recharging ) {
- game->fuel += 0.001;
+ game->fuel += 0.0001*dt;
}
/* Compensate for laziness elsewhere */