X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer_status.hpp;h=520bd7423296bf52d0ed1e823c13269df6505920;hb=89c801d4e00a0be36f6ad693a055505968ef9514;hp=29b8f83be2c91a5e265e5461b94d04d4f9cdd6ea;hpb=852dd1382ce743c7f999b8e8d2bd551bbd629bcc;p=supertux.git diff --git a/src/player_status.hpp b/src/player_status.hpp index 29b8f83be..520bd7423 100644 --- a/src/player_status.hpp +++ b/src/player_status.hpp @@ -1,7 +1,8 @@ // $Id$ // -// SuperTux - A Jump'n Run +// SuperTux // Copyright (C) 2003 Tobias Glaesser +// Copyright (C) 2006 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,11 +20,13 @@ #ifndef SUPERTUX_PLAYERSTATUS_H #define SUPERTUX_PLAYERSTATUS_H -#include -#include "lisp/lisp.hpp" -#include "timer.hpp" +#include #include "serializable.hpp" -#include "sprite/sprite.hpp" +#include "video/color.hpp" + +namespace lisp{ class Writer; } +namespace lisp{ class Lisp; } +class Surface; static const float BORDER_X = 10; static const float BORDER_Y = 10; @@ -33,52 +36,39 @@ enum BonusType { }; class DrawingContext; -/** +/** * This class memorizes player status between different game sessions (for * example when switching maps in the worldmap) */ class PlayerStatus : public Serializable { + static Color text_color; public: PlayerStatus(); ~PlayerStatus(); - void reset(); - void incLives(); - void incCoins(); - void set_keys(int new_key); + void reset(); + void add_coins(int count, bool play_sound = true); void write(lisp::Writer& writer); void read(const lisp::Lisp& lisp); void draw(DrawingContext& context); - void draw_keys(DrawingContext& context); int coins; BonusType bonus; + int max_fire_bullets; /**< maximum number of fire bullets in play */ + int max_ice_bullets; /**< maximum number of ice bullets in play */ int score_multiplier; int max_score_multiplier; void operator= (const PlayerStatus& other); - - enum { - KEY_BRASS = 0x001, - KEY_IRON = 0x002, - KEY_BRONZE = 0x004, - KEY_SILVER = 0x008, - KEY_GOLD = 0x010, - }; private: // don't use this PlayerStatus(const PlayerStatus& other); - - int keys; - Sprite* key_iron; - Sprite* key_brass; - Sprite* key_bronze; - Sprite* key_silver; - Sprite* key_gold; + + std::auto_ptr coin_surface; }; // global player state