+// $Id$
//
-// Interface: player/tux
+// SuperTux - A Jump'n Run
+// Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
//
-// Description:
-//
-//
-// Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
-//
-// Copyright: See COPYING file that comes with this distribution
+// 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 SUPERTUX_PLAYER_H
#define SUPERTUX_PLAYER_H
#include <vector>
-struct player_keymap_type
+struct PlayerKeymap
{
+public:
int jump;
int duck;
int left;
int right;
int fire;
+
+ PlayerKeymap();
};
+extern PlayerKeymap keymap;
+
struct player_input_type
{
int right;
void player_input_init(player_input_type* pplayer_input);
+class Sprite;
+
extern Surface* tux_life;
extern std::vector<Surface*> tux_right;
extern std::vector<Surface*> tux_left;
extern Surface* smalltux_jump_right;
extern Surface* smalltux_stand_left;
extern Surface* smalltux_stand_right;
-extern Surface* bigtux_right[3];
-extern Surface* bigtux_left[3];
-extern Surface* bigtux_right_jump;
-extern Surface* bigtux_left_jump;
-extern Surface* ducktux_right;
-extern Surface* ducktux_left;
+extern Sprite* bigtux_right;
+extern Sprite* bigtux_left;
+extern Sprite* bigtux_right_jump;
+extern Sprite* bigtux_left_jump;
+extern Sprite* ducktux_right;
+extern Sprite* ducktux_left;
extern Surface* skidtux_right;
extern Surface* skidtux_left;
extern Surface* firetux_right[3];
class Player
{
- public:
- player_keymap_type keymap;
-
+public:
player_input_type input;
bool got_coffee;
int size;
bool duck;
DyingType dying;
- int dir;
+
+ Direction dir;
+
bool jumping;
int frame_;
int frame_main;
Timer frame_timer;
Physic physic;
- public:
+public:
void init();
int key_event(SDLKey key, int state);
void level_begin();
bool on_ground();
bool under_solid();
- private:
+private:
void handle_horizontal_input();
void handle_vertical_input();
void remove_powerups();
};
#endif /*SUPERTUX_PLAYER_H*/
+
+/* Local Variables: */
+/* mode:c++ */
+/* End: */