#include "video/surface.h"
#include "moving_object.h"
#include "sprite/sprite.h"
-#include "math/physic.h"
+#include "physic.h"
#include "control/controller.h"
#include "player_status.h"
-using namespace SuperTux;
-
class BadGuy;
class Portable;
static const float TUX_INVINCIBLE_TIME = 10.0;
static const float TUX_INVINCIBLE_TIME_WARNING = 2.0;
static const float TUX_FLAPPING_TIME = 1; /* How long Tux can flap his wings to gain additional jump height */
-static const float TIME_WARNING = 20; /* When to alert player they're low on time! */
+static const float TUX_FLAPPING_STRENGTH = 100; /* How much Y velocity Tux gains when flapping */
+static const float TUX_FLAPPING_LEAST_X = 30; /* How much X velocity Tux gains when flapping from vertical jump */
static const float GROWING_TIME = 1.0;
static const int GROWING_FRAMES = 7;
void set_action(std::string action, int loops = -1);
void one_time_animation();
- void draw(DrawingContext& context, const Vector& pos, int layer,
- Uint32 drawing_effect = NONE_EFFECT);
+ void draw(DrawingContext& context, const Vector& pos, int layer);
Sprite* head;
Sprite* body;
int flaps_nb;
// temporary to help player's choosing a flapping
+ // TODO: remove this after agreeing on flapstyle!
enum { MAREK_FLAP, RICARDO_FLAP, RYAN_FLAP, NO_FLAP };
int flapping_mode;
- Timer2 invincible_timer;
- Timer2 skidding_timer;
- Timer2 safe_timer;
- Timer2 kick_timer;
- Timer2 shooting_timer; // used to show the arm when Tux is shooting
- Timer2 dying_timer;
- Timer2 growing_timer;
- Timer2 idle_timer;
- Timer2 flapping_timer;
+ Timer invincible_timer;
+ Timer skidding_timer;
+ Timer safe_timer;
+ Timer kick_timer;
+ Timer shooting_timer; // used to show the arm when Tux is shooting
+ Timer dying_timer;
+ Timer growing_timer;
+ Timer idle_timer;
+ Timer flapping_timer;
Physic physic;
public:
void set_controller(Controller* controller);
- virtual void action(float elapsed_time);
+ virtual void update(float elapsed_time);
virtual void draw(DrawingContext& context);
virtual HitResponse collision(GameObject& other, const CollisionHit& hit);