// $Id$
//
-// SuperTux - A Jump'n Run
-// Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+// SuperTux
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// 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_PLAYER_H
#define SUPERTUX_PLAYER_H
#include "scripting/player.hpp"
#include "player_status.hpp"
#include "display_effect.hpp"
+#include "script_interface.hpp"
#include "console.hpp"
+#include "coin.hpp"
class BadGuy;
class Portable;
extern TuxBodyParts* fire_tux;
extern TuxBodyParts* ice_tux;
-class Player : public MovingObject, public Scripting::Player, public ConsoleCommandReceiver
+class FallingCoin : public GameObject
+{
+public:
+ FallingCoin(const Vector& start_position, const int x_vel);
+ ~FallingCoin();
+
+ void draw(DrawingContext& context);
+ void update(float elapsed_time);
+private:
+ Vector pos;
+ Sprite* sprite;
+ Physic physic;
+};
+
+class Player : public MovingObject, public Scripting::Player, public ScriptInterface
{
public:
enum HurtMode { KILL, SHRINK };
Player(PlayerStatus* player_status);
virtual ~Player();
+ virtual void expose(HSQUIRRELVM vm, int table_idx);
+ virtual void unexpose(HSQUIRRELVM vm, int table_idx);
+
void set_controller(Controller* controller);
virtual void update(float elapsed_time);
void kill(HurtMode mode);
void check_bounds(Camera* camera);
void move(const Vector& vector);
+
+ virtual void set_bonus(const std::string& bonus);
+ virtual void add_coins(int count);
void set_bonus(BonusType type, bool animate = false);
PlayerStatus* get_status()
{
bool on_ground();
- bool consoleCommand(std::string command, std::vector<std::string> arguments); /**< callback from Console; return false if command was unknown, true otherwise */
-
private:
void handle_input();
bool deactivated;