Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / supertux / levelintro.hpp
1 //  SuperTux -- LevelIntro screen
2 //  Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
3 //
4 //  This program is free software: you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation, either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 #ifndef HEADER_SUPERTUX_SUPERTUX_LEVELINTRO_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_LEVELINTRO_HPP
19
20 #include "sprite/sprite.hpp"
21 #include "supertux/level.hpp"
22 #include "supertux/screen.hpp"
23 #include "supertux/timer.hpp"
24
25 class DrawingContext;
26 class Surface;
27
28 /**
29  * Screen that welcomes the player to a level
30  */
31 class LevelIntro : public Screen
32 {
33 private:
34   static Color header_color;
35   static Color author_color;
36   static Color stat_hdr_color;
37   static Color stat_color;
38
39 public:
40   LevelIntro(const Level* level, const Statistics* best_level_statistics);
41   virtual ~LevelIntro();
42
43   void setup();
44   void draw(DrawingContext& context);
45   void update(float elapsed_time);
46
47 private:
48   const Level* level; /**< The level of which this is the intro screen */
49   const Statistics* best_level_statistics; /**< Best level statistics of the level of which is the intro screen */
50   std::auto_ptr<Sprite> player_sprite; /**< Sprite representing the player */
51   float player_sprite_py; /**< Position (y axis) for the player sprite */
52   float player_sprite_vy; /**< Velocity (y axis) for the player sprite */
53   Timer player_sprite_jump_timer; /**< When timer fires, the player sprite will "jump" */
54 };
55
56 #endif
57
58 /* EOF */