From: LMH Date: Wed, 25 Jun 2014 23:57:27 +0000 (-1000) Subject: Auto-run levels are automatically marked as solved. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f90508343f1993e92a09fd0679fe188d285a4922;p=supertux.git Auto-run levels are automatically marked as solved. This prevents players from being forced back into an auto-run level if they should abort without finishing. Resolves apparent problem in issue #28. --- diff --git a/data/levels/world1/intro.nut b/data/levels/world1/intro.nut index 317b63366..e68e041f4 100644 --- a/data/levels/world1/intro.nut +++ b/data/levels/world1/intro.nut @@ -1,16 +1,16 @@ function intro() -{ +{ //initialize Camera.set_mode("manual"); Tux.deactivate(); // Tux.set_position(2291,1280); Tux.add_bonus("grow"); - RADIO.set_action("quiet"); + RADIO.set_action("quiet"); PENNY.set_action("stand-left"); NOLOK.set_visible(false); logo <- FloatingImage("images/objects/logo/logo.sprite"); Effect.sixteen_to_nine(0); - + //begin scrolling sequence Effect.fade_in(2); Camera.scroll_to(0, 945, 15); @@ -33,7 +33,7 @@ function intro() wait(2); logo.set_visible(false); wait(5.3); - + //begin conversation and Tux rap Tux.walk(0); play_sound("speech/tux_hello.ogg"); @@ -51,7 +51,7 @@ function intro() wait(2); shake_bush(); wait(1.3); - + //enter Nolok NOLOK.set_velocity(-220, 600); NOLOK.set_visible(true); @@ -75,7 +75,7 @@ function intro() wait(4); Tux.walk(3000); wait(2); - + //end intro sequence Effect.fade_out(2); wait(3); diff --git a/data/levels/world1/intro.stl b/data/levels/world1/intro.stl index fd0aed6a4..312987748 100644 --- a/data/levels/world1/intro.stl +++ b/data/levels/world1/intro.stl @@ -7,7 +7,7 @@ (name "main") (music "music/intro.ogg") (init-script " Tux.add_bonus(\"grow\"); - RADIO.set_action(\"quiet\"); + RADIO.set_action(\"quiet\"); PENNY.set_action(\"stand-left\"); NOLOK.set_visible(false); ") @@ -95,7 +95,7 @@ if(!(\"script_ran\" in this)) { wait(3); shake_bush(); wait(1.8); - + //enter Nolok NOLOK.set_velocity(-220, 600); NOLOK.set_visible(true); diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index ef0500390..c74e945df 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -80,7 +80,7 @@ WorldMap* WorldMap::current_ = NULL; WorldMap::WorldMap(const std::string& filename, PlayerStatus* player_status, const std::string& force_spawnpoint) : tux(0), player_status(player_status), - tileset(NULL), + tileset(NULL), free_tileset(false), worldmap_menu(), camera_offset(), @@ -101,9 +101,9 @@ WorldMap::WorldMap(const std::string& filename, PlayerStatus* player_status, con total_stats(), worldmap_table(), scripts(), - ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), + ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), force_spawnpoint(force_spawnpoint), - in_level(false), + in_level(false), pan_pos(), panning(false) { @@ -134,7 +134,7 @@ WorldMap::WorldMap(const std::string& filename, PlayerStatus* player_status, con sq_pop(global_vm, 1); sound_manager->preload("sounds/warp.wav"); - + // load worldmap objects load(filename); } @@ -371,7 +371,7 @@ WorldMap::get_level_target_time(LevelTile& level) level.target_time = last_target_time; return; } - + try { lisp::Parser parser; const lisp::Lisp* root = parser.parse(levels_path + level.get_name()); @@ -677,6 +677,8 @@ WorldMap::update(float delta) LevelTile* level = at_level(); if (level && (level->auto_play) && (!level->solved) && (!tux->is_moving())) { enter_level = true; + // automatically mark these levels as solved in case player aborts + level->solved = true; } if (enter_level && !tux->is_moving()) @@ -811,7 +813,7 @@ WorldMap::draw(DrawingContext& context) /* // FIXME: make this a runtime switch similar to draw_collrects/show_collrects? // draw visual indication of possible walk directions - static int flipme = 0; + static int flipme = 0; if (flipme++ & 0x04) for (int x = 0; x < get_width(); x++) { for (int y = 0; y < get_height(); y++) {