Let navigate through the worldmap using Tux keys as well.
[supertux.git] / src / door.h
index a0bae41..50d0138 100644 (file)
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#ifndef __DOOR_H__
-#define __DOOR_H__
+
+#ifndef SUPERTUX_DOOR_H
+#define SUPERTUX_DOOR_H
 
 #include <string>
+
+#include "video/surface.h"
 #include "interactive_object.h"
 #include "serializable.h"
+#include "special/timer.h"
 
+namespace SuperTux {
 class Sprite;
-
 class LispReader;
+}
+
+/** data images */
+#define DOOR_OPENING_TIME 1500
+#define DOOR_OPENING_FRAMES 8
+extern Sprite* door;
+extern Surface* door_opening[DOOR_OPENING_FRAMES];
 
 class Door : public InteractiveObject, public Serializable
 {
 public:
   Door(LispReader& reader);
+  Door(int x, int y);
   virtual ~Door();
 
   virtual void write(LispWriter& writer);
@@ -40,10 +52,11 @@ public:
   virtual void interaction(InteractionType type);
 
 private:
-  Sprite* sprite;
   std::string target_sector;
   std::string target_spawnpoint;
+  Timer animation_timer; //Used for door animation
+  bool door_activated;
 };
 
-#endif
+#endif /*SUPERTUX_DOOR_H*/