// $Id$
-//
+//
// SuperTux
-// Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
-// Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
#include <config.h>
#include <algorithm>
#include "video/drawing_context.hpp"
#include "camera.hpp"
#include "main.hpp"
+#include "random_generator.hpp"
BouncyCoin::BouncyCoin(const Vector& pos)
: position(pos)
{
- timer.start(.3);
- sprite = sprite_manager->create("coin");
+ timer.start(.3f);
+ sprite = sprite_manager->create("images/objects/coin/coin.sprite");
sprite->set_action("still");
}
void
BouncyCoin::draw(DrawingContext& context)
{
- sprite->draw(context, position, LAYER_OBJECTS);
+ sprite->draw(context, position, LAYER_OBJECTS + 5);
}
//---------------------------------------------------------------------------
const Vector& pos, const Vector& nmovement)
: sprite(new Sprite(*nsprite)), position(pos), movement(nmovement)
{
- timer.start(.2);
+ timer.start(.2f);
}
BrokenBrick::~BrokenBrick()
BrokenBrick::draw(DrawingContext& context)
{
sprite->draw_part(context,
- Vector(rand() % 16, rand() % 16), Vector(16, 16),
+ Vector(systemRandom.rand(16), systemRandom.rand(16)), Vector(16, 16),
position, LAYER_OBJECTS + 1);
}
FloatingText::FloatingText(const Vector& pos, const std::string& text_)
: position(pos), text(text_)
{
- timer.start(.1);
+ timer.start(.1f);
position.x -= text.size() * 8;
}
FloatingText::FloatingText(const Vector& pos, int score)
: position(pos)
{
- timer.start(.1);
+ timer.start(.1f);
// turn int into a string
char str[10];
SmokeCloud::SmokeCloud(const Vector& pos)
: position(pos)
{
- timer.start(.3);
+ timer.start(.3f);
sprite = sprite_manager->create("images/objects/particles/stomp.sprite");
}
{
sprite->draw(context, position, LAYER_OBJECTS+1);
}
-