3 // SuperTux - End Sequence
4 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.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.
22 #include "endsequence.hpp"
28 #include "resources.hpp"
30 #include "gettext.hpp"
31 #include "object_factory.hpp"
32 #include "object/player.hpp"
33 #include "video/drawing_context.hpp"
34 #include "lisp/list_iterator.hpp"
36 #include "scripting/level_time.hpp"
37 #include "scripting/squirrel_util.hpp"
39 EndSequence::EndSequence()
40 : isrunning(false), isdone(false), tux_may_walk(true)
42 end_sequence_controller = 0;
45 EndSequence::~EndSequence()
47 delete end_sequence_controller;
51 EndSequence::update(float elapsed_time)
53 if (!isrunning) return;
54 running(elapsed_time);
58 EndSequence::draw(DrawingContext& /*context*/)
65 if (isrunning) return;
69 Player& tux = *Sector::current()->player;
70 end_sequence_controller = new CodeController();
71 tux.set_controller(end_sequence_controller);
72 tux.set_speedlimit(230); //MAX_WALK_XM
78 EndSequence::stop_tux()
86 if (!isrunning) return;
93 EndSequence::is_tux_stopped()
99 EndSequence::is_done()
105 EndSequence::starting()
110 EndSequence::running(float /*elapsed_time*/)
115 EndSequence::stopping()