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.
 
 
 
VirusAttack/olcCodeJam2023Entry/VirusAttack.cpp

40 lines
797 B

#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#define OLC_SOUNDWAVE
#include "olcSoundWaveEngine.h"
#include "VirusAttack.h"
VirusAttack::VirusAttack()
{
// Name your application
sAppName = "olcCodeJam 2023 Entry";
}
bool VirusAttack::OnUserCreate(){
// Called once at the start, so create things here
VIRUS_IMG1.Load("assets/unit.png");
units.push_back(std::make_unique<BasicUnit>(vf2d{32,32},VIRUS_IMG1,true));
return true;
}
bool VirusAttack::OnUserUpdate(float fElapsedTime){
// Called once per frame, draws random coloured pixels
for(std::unique_ptr<Unit>&u:units){
u->Update(fElapsedTime);
}
for(std::unique_ptr<Unit>&u:units){
u->Draw(this);
}
return true;
}
int main()
{
VirusAttack app;
if (app.Construct(240, 160, 4, 4))
app.Start();
return 0;
}