The good old Neggs are back. https://sigonasr2.itch.io/meerca-chase-clone
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.
MeercaChase/MeercaChase.cpp

61 lines
1.2 KiB

#define OLC_PGE_APPLICATION
#include "pixelGameEngine.h"
using namespace std;
class MeercaChase : public olc::PixelGameEngine
{
public:
olc::Decal*meerca;
olc::Decal*negg;
const float UPDATE_RATE = 0.016666667f;
float accumulatedTime = 0.0f;
int frameCount=0;
int moveSpd=4;
float meercaPos[2] = {240,240};
MeercaChase()
{
sAppName = "Meerca Chase";
}
bool OnUserCreate() override
{
meerca = new olc::Decal(new olc::Sprite("assets/meerca.png"));
negg = new olc::Decal(new olc::Sprite("assets/negg.png"));
SetPixelMode(olc::Pixel::ALPHA);
ConsoleCaptureStdOut(true);
Clear(olc::DARK_GREY);
// Called once at the start, so create things here
return true;
}
bool OnUserUpdate(float fElapsedTime) override
{
accumulatedTime+=fElapsedTime;
while (accumulatedTime>=UPDATE_RATE) {
accumulatedTime-=UPDATE_RATE;
updateGame();
}
if (GetKey(olc::F1).bPressed) {
ConsoleShow(olc::F1,false);
}
// called once per frame
DrawDecal({meercaPos[0]-16,meercaPos[1]-16},meerca);
DrawDecal({32,64},negg,{1,1},olc::YELLOW);
return true;
}
void updateGame() {
}
};
int main()
{
MeercaChase game;
if (game.Construct(480, 480, 4, 4))
game.Start();
return 0;
}