X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmoving_object.hpp;h=d18615f1b231b1c8a7a9f481a5526bad4bf37bb7;hb=f53572ad2b744ddddd7cc4b6479489543d44f98d;hp=7117777a50f94731ea0308a3685a2376cd11545f;hpb=d62647592b4ccffa89794af6fa03faaced46999d;p=supertux.git diff --git a/src/moving_object.hpp b/src/moving_object.hpp index 7117777a5..d18615f1b 100644 --- a/src/moving_object.hpp +++ b/src/moving_object.hpp @@ -1,7 +1,7 @@ -// $Id: moving_object.h 2295 2005-03-30 01:52:14Z matzebraun $ +// $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -19,6 +19,8 @@ #ifndef SUPERTUX_MOVING_OBJECT_H #define SUPERTUX_MOVING_OBJECT_H +#include + #include "game_object.hpp" #include "collision_hit.hpp" #include "math/vector.hpp" @@ -30,6 +32,8 @@ class CollisionGrid; enum CollisionGroup { COLGROUP_DISABLED, COLGROUP_MOVING, + // moving object but don't collide against other moving objects + COLGROUP_MOVING_ONLY_STATIC, COLGROUP_STATIC, COLGROUP_MOVINGSTATIC, COLGROUP_TOUCHABLE, @@ -51,6 +55,11 @@ public: */ virtual HitResponse collision(GameObject& other, const CollisionHit& hit) = 0; + /** called when tiles with special attributes have been touched */ + virtual void collision_tile(uint32_t tile_attributes) + { + (void) tile_attributes; + } const Vector& get_pos() const { @@ -101,6 +110,10 @@ protected: Vector movement; /** The collision group */ CollisionGroup group; + +private: + // this is only here for internal collision detection use + Rect dest; }; #endif