The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdventuresInLestoria/Crawler/Emitter.cpp

19 lines
371 B

#include "Emitter.h"
std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;
Emitter::Emitter(float frequency,float timer)
:frequency(frequency),timer(timer){}
bool Emitter::Update(float fElapsedTime){
lastEmit=std::max(lastEmit-fElapsedTime,0.f);
if(lastEmit==0){
lastEmit=frequency;
Emit();
}
timer-=fElapsedTime;
if(timer<0){
return false;
}
return true;
}