From b45c4d9efd8883ffa435183633ecad76e88a3ce1 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 8 Jan 2007 21:24:52 +0000 Subject: [PATCH] Changed default gravity to 10.0 SVN-Revision: 4535 --- data/levels/world1/27 - No More Mr Ice Guy.stl | 1 - src/physic.cpp | 6 +++--- src/physic.hpp | 4 ++-- src/sector.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/data/levels/world1/27 - No More Mr Ice Guy.stl b/data/levels/world1/27 - No More Mr Ice Guy.stl index 96d81d0f7..3ceffd2ea 100644 --- a/data/levels/world1/27 - No More Mr Ice Guy.stl +++ b/data/levels/world1/27 - No More Mr Ice Guy.stl @@ -6,7 +6,6 @@ (sector (name "main") (music "music/bossattack.ogg") - (gravity 1000.000000) (tilemap (z-pos -100) (solid #f) diff --git a/src/physic.cpp b/src/physic.cpp index d7993cd30..5da55a34d 100644 --- a/src/physic.cpp +++ b/src/physic.cpp @@ -23,7 +23,7 @@ #include "physic.hpp" Physic::Physic() - : ax(0), ay(0), vx(0), vy(0), gravity_enabled_flag(true), gravity(1000) + : ax(0), ay(0), vx(0), vy(0), gravity_enabled_flag(true), gravity(10 * 100) { } @@ -144,13 +144,13 @@ Physic::gravity_enabled() const void Physic::set_gravity(float gravity) { - this->gravity = gravity; + this->gravity = gravity * 100; } float Physic::get_gravity() const { - return gravity; + return gravity / 100; } Vector diff --git a/src/physic.hpp b/src/physic.hpp index 037d85ed2..392218023 100644 --- a/src/physic.hpp +++ b/src/physic.hpp @@ -81,9 +81,9 @@ private: float ax, ay; /// horizontal and vertical velocity float vx, vy; - /// should we respect gravity in out calculations? + /// should we respect gravity in our calculations? bool gravity_enabled_flag; - /// current gravity to apply to object, if enabled + /// current gravity (multiplied by 100) to apply to object, if enabled float gravity; }; diff --git a/src/sector.cpp b/src/sector.cpp index c306517db..43804725a 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -74,7 +74,7 @@ bool Sector::draw_solids_only = false; Sector::Sector(Level* parent) : level(parent), currentmusic(LEVEL_MUSIC), - ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), gravity(1000.0), player(0), camera(0) + ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), gravity(10.0), player(0), camera(0) { add_object(new Player(player_status, "Tux")); add_object(new DisplayEffect("Effect")); -- 2.11.0