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;
			

	}
}
示例#2
0
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;
}
示例#3
0
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;
}
示例#4
0
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);
	*/
}
示例#5
0
    void RasterImageStub::SetColor(image_size_t x, image_size_t y, ArgbQuad color) {
        CheckCoordinates(x, y);

        colorMap[y * GetWidth() + x] = color;
    }
示例#6
0
    ArgbQuad RasterImageStub::GetColor(image_size_t x, image_size_t y) const {
        CheckCoordinates(x, y);

        return colorMap[y * GetWidth() + x];
    }