X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fskullyhop.hpp;h=5698fe625c0a3e5142fafd38e4e60c4aa05daf7a;hb=12a28b64dcce9c7ff706451b4f3aecd201cc8a5f;hp=c12962c62c46decefef69b2f82e11a00f8c6ad7b;hpb=7c2f8e23f9accd00bd9ee2319da8ab8aa341c7cf;p=supertux.git diff --git a/src/badguy/skullyhop.hpp b/src/badguy/skullyhop.hpp index c12962c62..5698fe625 100644 --- a/src/badguy/skullyhop.hpp +++ b/src/badguy/skullyhop.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SkullyHop - A Hopping Skull -// Copyright (C) 2006 Christoph Sommer +// Copyright (C) 2006 Christoph Sommer // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,14 +12,12 @@ // GNU General Public License for more details. // // 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. +// along with this program. If not, see . -#ifndef __SKULLYHOP_H__ -#define __SKULLYHOP_H__ +#ifndef HEADER_SUPERTUX_BADGUY_SKULLYHOP_HPP +#define HEADER_SUPERTUX_BADGUY_SKULLYHOP_HPP -#include "badguy.hpp" +#include "badguy/badguy.hpp" /** * Badguy "SkullyHop" - A Hopping Skull @@ -29,30 +25,30 @@ class SkullyHop : public BadGuy { public: - SkullyHop(const lisp::Lisp& reader); + SkullyHop(const Reader& reader); SkullyHop(const Vector& pos, Direction d); - void activate(); - void write(lisp::Writer& writer); - HitResponse collision_solid(GameObject& other, const CollisionHit& hit); + void initialize(); + void collision_solid(const CollisionHit& hit); HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); - bool collision_squished(Player& player); + bool collision_squished(GameObject& object); void active_update(float elapsed_time); - virtual SkullyHop* clone() const { return new SkullyHop(*this); } - -protected: +private: enum SkullyHopState { STANDING, CHARGING, JUMPING }; +private: + void set_state(SkullyHopState newState); + +private: Timer recover_timer; SkullyHopState state; - - void set_state(SkullyHopState newState); }; #endif +/* EOF */