X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcollision.h;h=85b89d7bd71f9f907328c020aff3b5c22b16e86b;hb=546364c9567ef212ea9276201facf73f5ada696a;hp=4a009e576da8965ec3f7013fcade52db2c118000;hpb=ddd864d8f63de465349cfb7b249b335a6b325066;p=supertux.git diff --git a/src/collision.h b/src/collision.h index 4a009e576..85b89d7bd 100644 --- a/src/collision.h +++ b/src/collision.h @@ -21,17 +21,20 @@ #ifndef SUPERTUX_COLLISION_H #define SUPERTUX_COLLISION_H -#include "type.h" +#include "special/base.h" + +using namespace SuperTux; class Tile; -class World; /* Collision objects */ enum { CO_BULLET, CO_BADGUY, - CO_PLAYER + CO_PLAYER, + CO_TRAMPOLINE, + CO_FLYING_PLATFORM }; enum CollisionType { @@ -53,7 +56,17 @@ Tile* gettile(float x, float y); bool issolid(float x, float y); bool isbrick(float x, float y); bool isice(float x, float y); +bool isspike(float x, float y); bool isfullbox(float x, float y); +typedef void* (*tiletestfunction)(Tile* tile); +/** invokes the function for each tile the baserectangle collides with. The + * function aborts and returns true as soon as the tiletestfunction returns + * != 0 then this value is returned. returns 0 if all tests failed. + */ +void* collision_func(const base_type& base, tiletestfunction* function); + +Tile* collision_goal(const base_type& base); + #endif /*SUPERTUX_COLLISION_H*/