Meerca position setup and grey background insteads

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 070f99c4b0
commit c830002446
  1. BIN
      MeercaChase
  2. 24
      MeercaChase.cpp

Binary file not shown.

@ -8,6 +8,11 @@ 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";
@ -18,25 +23,38 @@ public:
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({32,32},meerca);
DrawDecal({64,32},meerca);
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(256, 240, 4, 4))
if (game.Construct(480, 480, 4, 4))
game.Start();
return 0;

Loading…
Cancel
Save