X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer.h;h=6852ebc14e956c2569cb3f45d02098de6a21550b;hb=157cef71aeb9ae25b7bb90f37dda11bc09329d11;hp=d1e5b4af7ccacdaf718b674f21c5c52176777aa3;hpb=1b3974597dfcd1c36eba0f1ac2f7528f038e02d2;p=supertux.git diff --git a/src/player.h b/src/player.h index d1e5b4af7..6852ebc14 100644 --- a/src/player.h +++ b/src/player.h @@ -112,17 +112,22 @@ class Player : public MovingObject, public Drawable public: enum HurtMode { KILL, SHRINK }; enum Power { NONE_POWER, FIRE_POWER, ICE_POWER }; + enum FallMode { ON_GROUND, JUMPING, TRAMPOLINE_JUMP, FALLING }; player_input_type input; int got_power; int size; bool duck; bool holding_something; + bool dead; DyingType dying; Direction dir; Direction old_dir; + float last_ground_y; + FallMode fall_mode; + bool jumping; bool can_jump; bool butt_jump; @@ -135,6 +140,8 @@ public: Timer safe_timer; Timer frame_timer; Timer kick_timer; + Timer shooting_timer; // used to show the arm when Tux is shooting + Timer dying_timer; Physic physic; public: @@ -147,21 +154,21 @@ public: void grabdistros(); virtual void action(float elapsed_time); - virtual void draw(ViewPort& viewport, int layer); + virtual void draw(Camera& viewport, int layer); virtual void collision(const MovingObject& other_object, int collision_type); - virtual std::string type() const - { return "Player"; } void collision(void* p_c_object, int c_object); void kill(HurtMode mode); - void is_dying(); - bool is_dead(); void player_remove_powerups(); - void check_bounds(bool back_scrolling, bool hor_autoscroll); + void check_bounds(Camera& viewport, bool back_scrolling, bool hor_autoscroll); bool on_ground(); bool under_solid(); + bool tiles_on_air(int tiles); void grow(); + void move(const Vector& vector); + bool is_dead() const + { return dead; } private: void init();