#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);
+ timer.start(.3f);
sprite = sprite_manager->create("images/objects/coin/coin.sprite");
sprite->set_action("still");
}
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];
context.push_transform();
context.set_alpha(alpha);
- context.draw_text(gold_text, text, position, LEFT_ALLIGN, LAYER_OBJECTS+1);
+ context.draw_text(gold_text, text, position, ALIGN_LEFT, LAYER_OBJECTS+1);
context.pop_transform();
}
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);
}
-