src/badguy/yeti.hpp

Go to the documentation of this file.
00001 //  SuperTux - Boss "Yeti"
00002 //  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
00003 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
00004 //
00005 //  This program is free software: you can redistribute it and/or modify
00006 //  it under the terms of the GNU General Public License as published by
00007 //  the Free Software Foundation, either version 3 of the License, or
00008 //  (at your option) any later version.
00009 //
00010 //  This program is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //  GNU General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU General Public License
00016 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 #ifndef HEADER_SUPERTUX_BADGUY_YETI_HPP
00019 #define HEADER_SUPERTUX_BADGUY_YETI_HPP
00020 
00021 #include <memory>
00022 
00023 #include "badguy/badguy.hpp"
00024 
00025 class Yeti : public BadGuy
00026 {
00027 public:
00028   Yeti(const Reader& lisp);
00029   ~Yeti();
00030 
00031   void draw(DrawingContext& context);
00032   void initialize();
00033   void active_update(float elapsed_time);
00034   void collision_solid(const CollisionHit& hit);
00035   bool collision_squished(GameObject& object);
00036   void kill_squished(GameObject& object);
00037   void kill_fall();
00038 
00039 private:
00040   void run();
00041   void jump_up();
00042   void be_angry();
00043   void drop_stalactite();
00044   void jump_down();
00045 
00046   void draw_hit_points(DrawingContext& context);
00047 
00048   void take_hit(Player& player);
00049 
00050 private:
00051   enum YetiState {
00052     JUMP_DOWN,
00053     RUN,
00054     JUMP_UP,
00055     BE_ANGRY,
00056     SQUISHED
00057   };
00058 
00059 private:
00060   YetiState state;
00061   Timer state_timer;
00062   Timer safe_timer;
00063   int stomp_count;
00064   int hit_points;
00065   SurfacePtr hud_head;
00066 };
00067 
00068 #endif
00069 
00070 /* EOF */

Generated on Mon Jun 9 03:38:18 2014 for SuperTux by  doxygen 1.5.1