X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fbadguy.hpp;h=44613e47f7fd526f83b290dbeae72007b7dd20ad;hb=e7042da286e68756298cc205910b35c1da551167;hp=797cd44bf2e7e26b86ef0ef6fa014cd14a532b8e;hpb=2892ebda09d24c977547159e34abf0244884b89e;p=supertux.git diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index 797cd44bf..44613e47f 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -165,11 +165,24 @@ protected: */ Direction str2dir( std::string dir_str ); + /** + * Update on_ground_flag judging by solid collision @c hit. + * This gets called from the base implementation of collision_solid, so call this when overriding collision_solid's default behaviour. + */ + void update_on_ground_flag(const CollisionHit& hit); + + /** + * Returns true if we touched ground in the past frame + * This only works if update_on_ground_flag() gets called in collision_solid. + */ + bool on_ground(); + private: void try_activate(); State state; Timer state_timer; + bool on_ground_flag; }; #endif