00001 // SuperTux - End Sequence: Tux walks right 00002 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de> 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #include "object/endsequence_fireworks.hpp" 00018 00019 #include "object/fireworks.hpp" 00020 #include "supertux/globals.hpp" 00021 #include "supertux/screen_manager.hpp" 00022 #include "supertux/sector.hpp" 00023 00024 EndSequenceFireworks::EndSequenceFireworks() : 00025 EndSequence(), 00026 endsequence_timer() 00027 { 00028 } 00029 00030 EndSequenceFireworks::~EndSequenceFireworks() 00031 { 00032 } 00033 00034 void 00035 EndSequenceFireworks::draw(DrawingContext& /*context*/) 00036 { 00037 } 00038 00039 void 00040 EndSequenceFireworks::starting() 00041 { 00042 EndSequence::starting(); 00043 endsequence_timer.start(7.3f * g_screen_manager->get_speed()); 00044 Sector::current()->add_object(new Fireworks()); 00045 } 00046 00047 void 00048 EndSequenceFireworks::running(float elapsed_time) 00049 { 00050 EndSequence::running(elapsed_time); 00051 //Player& tux = *Sector::current()->player; 00052 00053 if (tux_may_walk) { 00054 end_sequence_controller->press(Controller::JUMP); 00055 } 00056 00057 if (endsequence_timer.check()) isdone = true; 00058 } 00059 00060 void 00061 EndSequenceFireworks::stopping() 00062 { 00063 EndSequence::stopping(); 00064 } 00065 00066 /* EOF */