#include "object/camera.hpp"
#include "random_generator.hpp"
-ParticleSystem::ParticleSystem()
+ParticleSystem::ParticleSystem(float max_particle_size)
+ : max_particle_size(max_particle_size)
{
- virtual_width = SCREEN_WIDTH + MAX_PARTICLE_SIZE * 2;
- virtual_height = SCREEN_HEIGHT + MAX_PARTICLE_SIZE *2;
+ virtual_width = SCREEN_WIDTH + max_particle_size * 2;
+ virtual_height = SCREEN_HEIGHT + max_particle_size *2;
z_pos = LAYER_BACKGROUND1;
}
float scrolly = context.get_translation().y;
context.push_transform();
- context.set_translation(Vector(MAX_PARTICLE_SIZE,MAX_PARTICLE_SIZE));
+ context.set_translation(Vector(max_particle_size,max_particle_size));
std::vector<Particle*>::iterator i;
for(i = particles.begin(); i != particles.end(); ++i) {
}
CloudParticleSystem::CloudParticleSystem()
+ : ParticleSystem(128)
{
cloudimage = new Surface("images/objects/particles/cloud.png");
class ParticleSystem : public GameObject
{
public:
- ParticleSystem();
+ ParticleSystem(float max_particle_size = 60);
virtual ~ParticleSystem();
virtual void draw(DrawingContext& context);
protected:
- enum {MAX_PARTICLE_SIZE = 64};
+ float max_particle_size;
int z_pos;
class Particle