Boundaries means death

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 3a8a914bbc
commit ace73b6bad
  1. BIN
      MeercaChase
  2. 9
      MeercaChase.cpp

Binary file not shown.

@ -202,12 +202,12 @@ public:
if (i!=tailSize-1&&abs(meercaPos[0]-meercaPreviousPos[(i*8+6)])<8&&abs(meercaPos[1]-meercaPreviousPos[(i*8+7)])<8) { if (i!=tailSize-1&&abs(meercaPos[0]-meercaPreviousPos[(i*8+6)])<8&&abs(meercaPos[1]-meercaPreviousPos[(i*8+7)])<8) {
init(); init();
} }
DrawCircle({(float)meercaPreviousPos[(i*8+6)],(float)meercaPreviousPos[(i*8+7)]},8); DrawCircle({(int)meercaPreviousPos[(i*8+6)],(int)meercaPreviousPos[(i*8+7)]},8);
} }
if (scoreTransparency>0) { if (scoreTransparency>0) {
scorePos[1]-=0.03; scorePos[1]-=0.06;
scoreTransparency--; scoreTransparency--;
DrawString({scorePos[0],scorePos[1]},"+"+to_string(scoreValue),olc::Pixel(0,0,255,scoreTransparency),2); DrawString({(int)scorePos[0],(int)scorePos[1]},"+"+to_string(scoreValue),olc::Pixel(0,0,255,scoreTransparency),2);
} }
return true; return true;
} }
@ -246,6 +246,9 @@ public:
spawnBadNegg(); spawnBadNegg();
} }
} }
if (meercaPos[0]<-8||meercaPos[0]>488||meercaPos[1]<-8||meercaPos[1]>488) {
init();
}
for (int i=0;i<badNeggCount;i++) { for (int i=0;i<badNeggCount;i++) {
if (abs(meercaPos[0]-badNeggs[i*2])<6&&abs(meercaPos[1]-badNeggs[i*2+1])<6) { if (abs(meercaPos[0]-badNeggs[i*2])<6&&abs(meercaPos[1]-badNeggs[i*2+1])<6) {
init(); init();

Loading…
Cancel
Save