Esempio n. 1
0
void Sprite::Draw()
{
	Sprite_Animate(this->frame, this->startframe, this->endframe,
		this->direction, this->starttime, this->delay);
	Sprite_Transform_Draw(this->img, this->Get_RealPosX(), this->Get_RealPosY(), this->width,
		this->height, this->frame, this->columns, 0, 1.0f, this->color);
}
Esempio n. 2
0
void Chameleon::draw()
{
	Reyk* player1 = players[clientIndex];

	if (abs((int)(chameleonX - player1->getCenterX())) > 1280
			|| abs((int)(chameleonY + 290 - player1->getCenterY())) > 1024)
		{
			return;
		}

	int curframe;
	int dirdiff = 9;
	if (direction == 1)
	{
		dirdiff = 0;
	}
	switch(status)
	{
	case 0:
		curframe = 0;
		frame = 0;
		break;
	case 1:
		curframe = OPENMOUTH[frame];
		break;
	case 2:
		curframe = MOVEMOUTH[frame];
		break;
	case 3:
		curframe = CLOSEMOUTH[frame];
		break;
	case 4:
		curframe = 0;
		break;
	case 5:
		curframe = BARF[frame];
		break;
	}

	curframe += dirdiff;

	//float xmod = player1->getMapX() - 415.0;
	//float ymod = player1->getMapY() - 415.0;

	float xmod = player1->getXmod();
	float ymod = player1->getYmod();

	int tongueframe = 0;
	if (direction == 1)
	{
		tongueframe = 1;
	}

	if (playercaught)
	{
		Sprite_Transform_Draw(tongueTexture, tongueX - xmod, tongueY - ymod, 1150, 290, tongueframe);
		players[whichplayer]->Reyk_Transform_Draw();
		Sprite_Transform_Draw(chameleonTexture, chameleonX - xmod, chameleonY - ymod, 580, 580, curframe, 9);
	}
	else
	{
		Sprite_Transform_Draw(tongueTexture, tongueX - xmod, tongueY - ymod, 1150, 290, tongueframe);
		Sprite_Transform_Draw(chameleonTexture, chameleonX - xmod, chameleonY - ymod, 580, 580, curframe, 9);
	}
}
Esempio n. 3
0
//Stone类
void Stone::Draw()
{
	Sprite_Transform_Draw(this->img, this->Get_RealPosX(), this->Get_RealPosY(), this->width,
		this->height, this->frame, this->columns, 0, 1.0f, this->color);
}
void MyMouseCursor::draw()
{
	Sprite_Transform_Draw(cursorTexture, mouseX, mouseY, 20, 20, 0, 1, 0, 3);
}