X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fspecial.h;h=0e69b8914b2466a3ec55738e237e17e902265745;hb=e68610f027ad6f35025d9aca87202ceb4501e97e;hp=c246bd8ef253ba72cb9dd48aed4ff40d18dd9f57;hpb=e40fdda30634b3b59a7d782b9d0642bf0209928c;p=supertux.git diff --git a/src/special.h b/src/special.h index c246bd8ef..0e69b8914 100644 --- a/src/special.h +++ b/src/special.h @@ -1,66 +1,89 @@ +// $Id$ // -// C Interface: special +// SuperTux - A Jump'n Run +// Copyright (C) 2003 Tobias Glaesser // -// Description: +// 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 distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. // -// Author: Tobias Glaesser , (C) 2004 -// -// Copyright: See COPYING file that comes with this distribution -// -// - -#define BULLET_STARTING_YM 1 -#define BULLET_XM 5 +// 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 SUPERTUX_SPECIAL_H #define SUPERTUX_SPECIAL_H -#include +#include "SDL.h" + #include "bitmask.h" -#include "type.h" -#include "texture.h" +#include "special/base.h" +#include "video/surface.h" #include "collision.h" #include "player.h" +#include "math/physic.h" /* Upgrade types: */ -enum { - UPGRADE_MINTS, - UPGRADE_COFFEE, - UPGRADE_HERRING +enum UpgradeKind { + UPGRADE_GROWUP, + UPGRADE_FIREFLOWER, + UPGRADE_ICEFLOWER, + UPGRADE_STAR, + UPGRADE_1UP }; -class Upgrade +void load_special_gfx(); +void free_special_gfx(); + +class Upgrade : public MovingObject { - public: - int kind; - base_type base; - base_type old_base; +public: + UpgradeKind kind; + Direction dir; + Physic physic; + + Upgrade(const Vector& pos, Direction dir, UpgradeKind kind); + virtual ~Upgrade(); + + virtual void action(float frame_ratio); + virtual void draw(DrawingContext& context); - void init(float x, float y, int dir, int kind); - void action(); - void draw(); - void collision(void* p_c_object, int c_object); + virtual void collision(const MovingObject& other, int); + void collision(void* p_c_object, int c_object, CollisionType type); + +private: + void bump(Player* player); +}; + +enum BulletsKind { + FIRE_BULLET, + ICE_BULLET }; -class Bullet +class Bullet : public MovingObject { - public: - base_type base; - base_type old_base; +public: + Bullet(const Vector& pos, float xm, int dir, + int kind); - void init(float x, float y, float xm, int dir); - void action(); - void draw(); + virtual void action(float frame_ratio); + virtual void draw(DrawingContext& context); void collision(int c_object); -}; -extern texture_type img_bullet; -extern bitmask* bm_bullet; + virtual void collision(const MovingObject& other_object, int type); -void create_special_bitmasks(); - -extern texture_type img_golden_herring; + int kind; + +private: + int life_count; + Physic physic; +}; #endif /*SUPERTUX_SPECIAL_H*/