1
0
Fork 0
blockofighter/src/particle.h

52 lines
804 B
C
Raw Normal View History

2014-02-16 14:32:28 +00:00
#ifndef __PARTICLE_H_INCLUDED__
#define __PARTICLE_H_INCLUDED__
class Particle;
class BloodAppearance;
#include "object.h"
#include "legoblocks.h"
#include "world.h"
2015-06-03 12:29:34 +00:00
class Particle : public MeshObject {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int bounces;
bool enabled;
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
World *world;
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
bool alive;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
int lifetime;
int id;
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
Particle(World *world, Mesh *mesh);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void move(void);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void hitForce(float speed, Object *source);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void create(float *position, float *velocity);
void destroy(void);
2014-02-16 14:32:28 +00:00
};
#define MAXBLOOD 500
2015-06-03 12:29:34 +00:00
class BloodAppearance : public BasicBlockAppearance {
2014-02-16 14:32:28 +00:00
private:
2015-06-03 12:29:34 +00:00
int *lifetime;
2014-02-16 14:32:28 +00:00
public:
2015-06-03 12:29:34 +00:00
BloodAppearance(int *lifetime);
2014-02-16 14:32:28 +00:00
2015-06-03 12:29:34 +00:00
void draw(void);
2014-02-16 14:32:28 +00:00
};
void initBloods(World *world);
void createBlood(float *position, float *velocity);
void removeBlood(int id);
void removeAllBlood();
2014-02-16 14:32:28 +00:00
#endif