#pragma once
#include "olcPixelGameEngine.h"

struct Emitter{
	friend class Crawler;
	float frequency;
	float timer;
	float lastEmit=0;
private:
	bool dead=false;
public:
	virtual ~Emitter()=default;
	Emitter(float frequency,float timer);
	bool Update(float fElapsedTime);
	virtual void Emit()=0;
};

class LightningBoltEmitter:public Emitter{
	vf2d startPos,endPos;
	bool upperLevel;
	void DrawLightningBolt();
	void Emit()override;
public:
	LightningBoltEmitter(vf2d startPos,vf2d endPos,float frequency,float timer,bool upperLevel);
};