X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Fplayer.hpp;h=45f3d849d24f709c9bbde0f975c9b6a376d922bd;hb=7d3004fc6167b7fcd7495dd1ac278f2ac527cbec;hp=9c1f009fe867c22c902b884657c167e0cc8a4007;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/scripting/player.hpp b/src/scripting/player.hpp index 9c1f009fe..45f3d849d 100644 --- a/src/scripting/player.hpp +++ b/src/scripting/player.hpp @@ -1,5 +1,24 @@ -#ifndef __PLAYER_H__ -#define __PLAYER_H__ +// $Id$ +// +// SuperTux +// 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 +// 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. +// +// 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 __SCRIPTING_PLAYER_H__ +#define __SCRIPTING_PLAYER_H__ namespace Scripting { @@ -14,21 +33,85 @@ public: /** * Set tux bonus. - * This can be "grow", "fireflow" or "iceflower" at the moment + * This can be "grow", "fireflower" or "iceflower" at the moment */ - virtual void set_bonus(const std::string& bonus) = 0; + virtual void add_bonus(const std::string& bonus) = 0; + /** + * Give tux more coins + */ + virtual void add_coins(int count) = 0; /** * Make tux invicible for a short amount of time */ virtual void make_invincible() = 0; /** - * Give tux another life + * Deactivate user input for Tux */ - virtual void add_life() = 0; + virtual void deactivate() = 0; /** - * Give tux more coins + * Give control back to user */ - virtual void add_coins(int count) = 0; + virtual void activate() = 0; + /** + * Make Tux walk + */ + virtual void walk(float speed) = 0; + /** + * Set player visible or not visible + */ + virtual void set_visible(bool visible) = 0; + /** + * returns true if the player is currently visible (that is he was not set + * inivisible by the set_visible method) + */ + virtual bool get_visible() = 0; + + /** + * Hurts a player, if completely=true then the player will be killed even + * if he had grow or fireflower bonus + */ + virtual void kill(bool completely) = 0; + + /** + * Switches ghost mode on/off. + * Lets Tux float around and through solid objects. + */ + virtual void set_ghost_mode(bool enable) = 0; + + /** + * Returns whether ghost mode is currently enabled + */ + virtual bool get_ghost_mode() = 0; + + /** + * play cheer animation. + * This might need some space and behave in an unpredictable way. Best to use this at level end. + */ + virtual void do_cheer() = 0; + + /** + * duck down if possible. + * this won't last long as long as input is enabled. + */ + virtual void do_duck() = 0; + + /** + * stand back up if possible. + */ + virtual void do_standup() = 0; + + /** + * do a backflip if possible. + */ + virtual void do_backflip() = 0; + + /** + * jump in the air if possible + * sensible values for yspeed are negative - unless we want to jump into the ground of course + */ + virtual void do_jump(float yspeed) = 0; + + }; }