#include "../pattern.h"

class TestPattern : public Pattern {
public:
	bool step(float deltaTime, float curTime) {
		// Spawn bullets
		int n = 100;
		for (int i=0; i<n; i++) {
			float a = i*M_PI*2.0f/n + curTime;
			float m = 1000;
		
			spSprite bullet(new Bullet::Simple(Bullet::Green, Vector2f(0, 0), Vector2f(m * cos(a), m * sin(a)))); 

			//Sprite* o = new(pool.malloc()) Bullet::Simple(Bullet::Green, Vector2f(0, 0), Vector2f(m * cos(a), m * sin(a)));
			//spSprite bullet(o, [] (Sprite* ptr) { ptr->~Sprite(); pool.free(ptr); }); 
		
			spawn(bullet);
		}

		return true;
	}
};

REGISTER_PATTERN("test", TestPattern);
