(sector
(name "main")
(music "music/bossattack.ogg")
- (gravity 1000.000000)
(tilemap
(z-pos -100)
(solid #f)
#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)
{
}
void
Physic::set_gravity(float gravity)
{
- this->gravity = gravity;
+ this->gravity = gravity * 100;
}
float
Physic::get_gravity() const
{
- return gravity;
+ return gravity / 100;
}
Vector
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;
};
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"));