void Player::Update(unsigned long frameNumber) { switch(currentState) { case DyingState: lives--; if(lives <= 0) { Destroy(); currentLevel->PlayerNull(); } else { SetPosition(0,0); SetState(NormalState); } SetState(NormalState); break; case NormalState: //RotateToLookAt(lookAtPoint); CheckCoordinates(); break; } }
void Bitmap::SetPixel(int x, int y, const RGBColor &c) { CheckCoordinates(x, y); data_[y * bi_.width + x].red = c.r(); data_[y * bi_.width + x].green = c.g(); data_[y * bi_.width + x].blue = c.b(); return; }
RGBColor Bitmap::GetPixel(int x, int y) const { CheckCoordinates(x, y); const int r = data_[y * bi_.width + x].red; const int g = data_[y * bi_.width + x].green; const int b = data_[y * bi_.width + x].blue; RGBColor rgb(r, g, b); return rgb; }
void MediumRock::Update(unsigned long frameNumber) { switch(currentState) { case NormalState: CheckCoordinates(); break; case BlastState: BlastRock(); break; } /* float x = GetVelocity().x; float y = GetVelocity().y; printf("%f, %f", &x, &y); */ }
void RasterImageStub::SetColor(image_size_t x, image_size_t y, ArgbQuad color) { CheckCoordinates(x, y); colorMap[y * GetWidth() + x] = color; }
ArgbQuad RasterImageStub::GetColor(image_size_t x, image_size_t y) const { CheckCoordinates(x, y); return colorMap[y * GetWidth() + x]; }