currentsector->activate("main");
}
- //levelintro();
-
sound_manager->stop_music();
currentsector->play_music(LEVEL_MUSIC);
}
void
-GameSession::levelintro()
-{
- sound_manager->stop_music();
-
- DrawingContext context;
- for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin();
- i != currentsector->gameobjects.end(); ++i) {
- Background* background = dynamic_cast<Background*> (*i);
- if(background) {
- background->draw(context);
- }
- Gradient* gradient = dynamic_cast<Gradient*> (*i);
- if(gradient) {
- gradient->draw(context);
- }
- }
-
-// context.draw_text(gold_text, level->get_name(), Vector(SCREEN_WIDTH/2, 160),
-// ALIGN_CENTER, LAYER_FOREGROUND1);
- context.draw_center_text(gold_text, level->get_name(), Vector(0, 160),
- LAYER_FOREGROUND1);
-
- std::stringstream ss_coins;
- ss_coins << _("Coins") << ": " << player_status->coins;
- context.draw_text(white_text, ss_coins.str(), Vector(SCREEN_WIDTH/2, 210),
- ALIGN_CENTER, LAYER_FOREGROUND1);
-
- if((level->get_author().size()) && (level->get_author() != "SuperTux Team"))
- context.draw_text(white_small_text,
- std::string(_("contributed by ")) + level->get_author(),
- Vector(SCREEN_WIDTH/2, 350), ALIGN_CENTER, LAYER_FOREGROUND1);
-
- if(best_level_statistics != NULL)
- best_level_statistics->draw_message_info(context, _("Best Level Statistics"));
-
- wait_for_event(1.0, 3.0);
-}
-
-void
GameSession::on_escape_press()
{
if(currentsector->player->is_dying() || end_sequence)
void process_events();
void capture_demo_step();
- void levelintro();
void drawstatus(DrawingContext& context);
void draw_pause(DrawingContext& context);
-// $Id: textscroller.cpp 4981 2007-04-15 15:41:27Z sommer $
+// $Id$
//
// SuperTux -- LevelIntro screen
// Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
#include "random_generator.hpp"
-static const float DEFAULT_SPEED = 20;
-static const float LEFT_BORDER = 50;
-static const float SCROLL = 60;
-static const float ITEMS_SPACE = 4;
-
LevelIntro::LevelIntro(const Level* level, const Statistics* best_level_statistics)
: level(level), best_level_statistics(best_level_statistics), player_sprite_py(0), player_sprite_vy(0)
{
py += white_text->get_height();
}
- py += 32;
-
-
}
-// $Id: textscroller.hpp 5330 2008-02-18 19:30:28Z sommer $
+// $Id$
//
// SuperTux -- LevelIntro screen
// Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
}
void
-Statistics::draw_message_info(DrawingContext& context, std::string title)
-{
- // skip draw if level was never played
- // TODO: do we need this?
- if (coins == nv_coins) return;
-
- // skip draw if stats were declared invalid
- if (!valid) return;
-
- const float width = white_small_text->get_text_width("Max coins collected: 1111 / 1111");
- const float left = (SCREEN_WIDTH - width) / 2;
- const float right = (SCREEN_WIDTH + width) / 2;
-
- context.draw_text(gold_text, title, Vector(SCREEN_WIDTH/2, 410), ALIGN_CENTER, LAYER_GUI);
-
- char stat_buf[128];
- int py = 450 + 18;
-
- snprintf(stat_buf, sizeof(stat_buf), "%d/%d", coins, total_coins);
- context.draw_text(white_small_text, _("Max coins collected:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI);
- context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI);
- py+=18;
-
- snprintf(stat_buf, sizeof(stat_buf), "%d/%d", badguys, total_badguys);
- context.draw_text(white_small_text, _("Max fragging:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI);
- context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI);
- py+=18;
-
- int csecs = (int)(time * 100);
- int mins = (int)(csecs / 6000);
- int secs = (csecs % 6000) / 100;
- snprintf(stat_buf, sizeof(stat_buf), "%02d:%02d", mins,secs);
- context.draw_text(white_small_text, _("Min time needed:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI);
- context.draw_text(white_small_text, "%02d:%02d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI);
- py+=18;
-
- snprintf(stat_buf, sizeof(stat_buf), "%d/%d", secrets, total_secrets);
- context.draw_text(white_small_text, _("Max secrets found:"), Vector(left, py), ALIGN_LEFT, LAYER_GUI);
- context.draw_text(white_small_text, "%d / %d", Vector(right, py), ALIGN_RIGHT, LAYER_GUI);
- py+=18;
-}
-
-void
Statistics::draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop)
{
// skip draw if level was never played
void unserialize_from_squirrel(HSQUIRRELVM vm);
void draw_worldmap_info(DrawingContext& context); /**< draw worldmap stat HUD */
- void draw_message_info(DrawingContext& context, std::string title); /**< draw stats at level start */
void draw_endseq_panel(DrawingContext& context, Statistics* best_stats, Surface* backdrop); /**< draw panel shown during level's end sequence */
void zero(); /**< Set stats to zero */