4 // Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef HEADER_WORLDMAP_HXX
21 #define HEADER_WORLDMAP_HXX
26 namespace WorldMapNS {
30 Point() : x(0), y(0) {}
32 Point(const Point& pos)
33 : x(pos.x), y(pos.y) {}
35 Point& operator=(const Point& pos)
58 // Directions in which Tux is allowed to walk from this tile
64 /** Stop on this tile or walk over it? */
71 typedef std::vector<Tile*> Tiles;
73 static TileManager* instance_ ;
77 static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); }
87 texture_type tux_sprite;
88 texture_type level_sprite;
94 std::vector<int> tilemap;
98 typedef std::vector<Level> Levels;
103 enum Direction { NONE, WEST, EAST, NORTH, SOUTH };
104 Direction tux_direction;
106 /** Length by which tux is away from its current tile, length is in
107 input_direction direction */
111 Direction input_direction;
115 Point get_next_tile(Point pos, Direction direction);
116 bool path_ok(Direction direction, Point old_pos, Point* new_pos);
128 /** Update Tux position */
131 /** Draw one frame */
135 } // namespace WorldMapNS
141 /* Local Variables: */