Exemplo n.º 1
0
void Equip::Update(float deltaTime) {
	mDragSprite.Update(deltaTime);
	mStats.Update(deltaTime);

	mStats.SetPosition(mDragSprite.GetPosition() + SVector2(13.5f, 228.0f));

	SVector2 position = mDragSprite.GetPosition();
	float x = Input_GetMouseScreenX() - position.x;
	float y = Input_GetMouseScreenY() - position.y - 32;

	bool mouseDown = Input_IsMousePressed(Mouse::LBUTTON);

	// Exit Button
	if (mouseDown && x > 260 && x < 290 && y < 2) {
		mDragSprite.ToggleVisible();
	}

	// Stat Button
	if ((mouseDown && x > 77 && x < 220 && y > 168 && y < 187)) {
		mStats.ToggleVisible();
	}
}
Exemplo n.º 2
0
void InputBox::Update(float deltaTime)
{
	mSprite.Update(deltaTime);

	// Update caret info
	mCaret += deltaTime;
	if (mCaret > CARET_BLINK_RATE_SECONDS) {
		mCaret -= CARET_BLINK_RATE_SECONDS;
	}

	SVector2 mouse((float) Input_GetMouseScreenX(), (float) Input_GetMouseScreenY());
	// If a mouse click is detected this box is no longer selected. Below it checks if it is the one being clicked on
	if(Input_IsMousePressed(Mouse::LBUTTON))
	{
		mActive = mouse.x > (mPosition.x - 25) && mouse.x < mPosition.x + mWidth && mouse.y > (mPosition.y - 25) && mouse.y < mPosition.y + mHeight;
	}

	// If Active Capture Text
	if(mActive)
	{
		// Dont go over max length
		if(mTextPosition < mMaxLength)
		{		if (Input_IsKeyDown(Keys::LSHIFT) || Input_IsKeyDown(Keys::RSHIFT) )
				{
					if(Input_IsKeyPressed(Keys::A)) { mText[mTextPosition++] = 'A'; }
					if(Input_IsKeyPressed(Keys::B)) { mText[mTextPosition++] = 'B'; }
					if(Input_IsKeyPressed(Keys::C)) { mText[mTextPosition++] = 'C'; }
					if(Input_IsKeyPressed(Keys::D)) { mText[mTextPosition++] = 'D'; }
					if(Input_IsKeyPressed(Keys::E)) { mText[mTextPosition++] = 'E'; }
					if(Input_IsKeyPressed(Keys::F)) { mText[mTextPosition++] = 'F'; }
					if(Input_IsKeyPressed(Keys::G)) { mText[mTextPosition++] = 'G'; }
					if(Input_IsKeyPressed(Keys::H)) { mText[mTextPosition++] = 'H'; }
					if(Input_IsKeyPressed(Keys::I)) { mText[mTextPosition++] = 'I'; }
					if(Input_IsKeyPressed(Keys::J)) { mText[mTextPosition++] = 'J'; }
					if(Input_IsKeyPressed(Keys::K)) { mText[mTextPosition++] = 'K'; }
					if(Input_IsKeyPressed(Keys::L)) { mText[mTextPosition++] = 'L'; }
					if(Input_IsKeyPressed(Keys::M)) { mText[mTextPosition++] = 'M'; }
					if(Input_IsKeyPressed(Keys::N)) { mText[mTextPosition++] = 'N'; }
					if(Input_IsKeyPressed(Keys::O)) { mText[mTextPosition++] = 'O'; }
					if(Input_IsKeyPressed(Keys::P)) { mText[mTextPosition++] = 'P'; }
					if(Input_IsKeyPressed(Keys::Q)) { mText[mTextPosition++] = 'Q'; }
					if(Input_IsKeyPressed(Keys::R)) { mText[mTextPosition++] = 'R'; }
					if(Input_IsKeyPressed(Keys::S)) { mText[mTextPosition++] = 'S'; }
					if(Input_IsKeyPressed(Keys::T)) { mText[mTextPosition++] = 'T'; }
					if(Input_IsKeyPressed(Keys::U)) { mText[mTextPosition++] = 'U'; }
					if(Input_IsKeyPressed(Keys::V)) { mText[mTextPosition++] = 'V'; }
					if(Input_IsKeyPressed(Keys::W)) { mText[mTextPosition++] = 'W'; }
					if(Input_IsKeyPressed(Keys::X)) { mText[mTextPosition++] = 'X'; }
					if(Input_IsKeyPressed(Keys::Y)) { mText[mTextPosition++] = 'Y'; }
					if(Input_IsKeyPressed(Keys::Z)) { mText[mTextPosition++] = 'Z'; }

					if(Input_IsKeyPressed(Keys::SEMICOLON)) { mText[mTextPosition++] = ':'; }
					if(Input_IsKeyPressed(Keys::ONE)) { mText[mTextPosition++] = '!'; }
					if(Input_IsKeyPressed(Keys::TWO)) { mText[mTextPosition++] = '@'; }
					if(Input_IsKeyPressed(Keys::THREE)) { mText[mTextPosition++] = '#'; }
					if(Input_IsKeyPressed(Keys::FOUR)) { mText[mTextPosition++] = '$'; }
					if(Input_IsKeyPressed(Keys::FIVE)) { mText[mTextPosition++] = '%'; }
					if(Input_IsKeyPressed(Keys::SIX)) { mText[mTextPosition++] = '^'; }
					if(Input_IsKeyPressed(Keys::SEVEN)) { mText[mTextPosition++] = '&'; }
					if(Input_IsKeyPressed(Keys::EIGHT)) { mText[mTextPosition++] = '*'; }
					if(Input_IsKeyPressed(Keys::NINE)) { mText[mTextPosition++] = '('; }
					if(Input_IsKeyPressed(Keys::ZERO)) { mText[mTextPosition++] = ')'; }
					if(Input_IsKeyPressed(Keys::SLASH)) { mText[mTextPosition++] = '?'; }
					if(Input_IsKeyPressed(Keys::PERIOD)) { mText[mTextPosition++] = '>'; }
					if(Input_IsKeyPressed(Keys::COMMA)) { mText[mTextPosition++] = '<'; }
					if(Input_IsKeyPressed(Keys::APOSTROPHE)) { mText[mTextPosition++] = '"'; }
					if(Input_IsKeyPressed(Keys::GRAVE)) { mText[mTextPosition++] = '~'; }
					if(Input_IsKeyPressed(Keys::LBRACKET)) { mText[mTextPosition++] = '{'; }
					if(Input_IsKeyPressed(Keys::RBRACKET)) { mText[mTextPosition++] = '}'; }
				}
				else
				{
					if(Input_IsKeyPressed(Keys::A)) { mText[mTextPosition++] = 'a'; }
					if(Input_IsKeyPressed(Keys::B)) { mText[mTextPosition++] = 'b'; }
					if(Input_IsKeyPressed(Keys::C)) { mText[mTextPosition++] = 'c'; }
					if(Input_IsKeyPressed(Keys::D)) { mText[mTextPosition++] = 'd'; }
					if(Input_IsKeyPressed(Keys::E)) { mText[mTextPosition++] = 'e'; }
					if(Input_IsKeyPressed(Keys::F)) { mText[mTextPosition++] = 'f'; }
					if(Input_IsKeyPressed(Keys::G)) { mText[mTextPosition++] = 'g'; }
					if(Input_IsKeyPressed(Keys::H)) { mText[mTextPosition++] = 'h'; }
					if(Input_IsKeyPressed(Keys::I)) { mText[mTextPosition++] = 'i'; }
					if(Input_IsKeyPressed(Keys::J)) { mText[mTextPosition++] = 'j'; }
					if(Input_IsKeyPressed(Keys::K)) { mText[mTextPosition++] = 'k'; }
					if(Input_IsKeyPressed(Keys::L)) { mText[mTextPosition++] = 'l'; }
					if(Input_IsKeyPressed(Keys::M)) { mText[mTextPosition++] = 'm'; }
					if(Input_IsKeyPressed(Keys::N)) { mText[mTextPosition++] = 'n'; }
					if(Input_IsKeyPressed(Keys::O)) { mText[mTextPosition++] = 'o'; }
					if(Input_IsKeyPressed(Keys::P)) { mText[mTextPosition++] = 'p'; }
					if(Input_IsKeyPressed(Keys::Q)) { mText[mTextPosition++] = 'q'; }
					if(Input_IsKeyPressed(Keys::R)) { mText[mTextPosition++] = 'r'; }
					if(Input_IsKeyPressed(Keys::S)) { mText[mTextPosition++] = 's'; }
					if(Input_IsKeyPressed(Keys::T)) { mText[mTextPosition++] = 't'; }
					if(Input_IsKeyPressed(Keys::U)) { mText[mTextPosition++] = 'u'; }
					if(Input_IsKeyPressed(Keys::V)) { mText[mTextPosition++] = 'v'; }
					if(Input_IsKeyPressed(Keys::W)) { mText[mTextPosition++] = 'w'; }
					if(Input_IsKeyPressed(Keys::X)) { mText[mTextPosition++] = 'x'; }
					if(Input_IsKeyPressed(Keys::Y)) { mText[mTextPosition++] = 'y'; }
					if(Input_IsKeyPressed(Keys::Z)) { mText[mTextPosition++] = 'z'; }

					if(Input_IsKeyPressed(Keys::ZERO)) { mText[mTextPosition++] = '0'; }
					if(Input_IsKeyPressed(Keys::ONE)) { mText[mTextPosition++] = '1'; }
					if(Input_IsKeyPressed(Keys::TWO)) { mText[mTextPosition++] = '2'; }
					if(Input_IsKeyPressed(Keys::THREE)) { mText[mTextPosition++] = '3'; }
					if(Input_IsKeyPressed(Keys::FOUR)) { mText[mTextPosition++] = '4'; }
					if(Input_IsKeyPressed(Keys::FIVE)) { mText[mTextPosition++] = '5'; }
					if(Input_IsKeyPressed(Keys::SIX)) { mText[mTextPosition++] = '6'; }
					if(Input_IsKeyPressed(Keys::SEVEN)) { mText[mTextPosition++] = '7'; }
					if(Input_IsKeyPressed(Keys::EIGHT)) { mText[mTextPosition++] = '8'; }
					if(Input_IsKeyPressed(Keys::NINE)) { mText[mTextPosition++] = '9'; }
					if(Input_IsKeyPressed(Keys::SLASH)) { mText[mTextPosition++] = '/'; }
					if(Input_IsKeyPressed(Keys::PERIOD)) { mText[mTextPosition++] = '.'; }
					if(Input_IsKeyPressed(Keys::APOSTROPHE)) { mText[mTextPosition++] = '\''; }
					if(Input_IsKeyPressed(Keys::COMMA)) { mText[mTextPosition++] = ','; }
					if(Input_IsKeyPressed(Keys::MINUS)) { mText[mTextPosition++] = '-'; }
					if(Input_IsKeyPressed(Keys::EQUALS)) { mText[mTextPosition++] = '='; }
					if(Input_IsKeyPressed(Keys::SEMICOLON)) { mText[mTextPosition++] = ';'; }
					if(Input_IsKeyPressed(Keys::GRAVE)) { mText[mTextPosition++] = '`'; }
					if(Input_IsKeyPressed(Keys::LBRACKET)) { mText[mTextPosition++] = '['; }
					if(Input_IsKeyPressed(Keys::RBRACKET)) { mText[mTextPosition++] = ']'; }
				}

				if(Input_IsKeyPressed(Keys::SPACE)) { mText[mTextPosition++] = ' '; }
		}

		// Backspace
		if(mTextPosition > 0 && Input_IsKeyPressed(Keys::BACKSPACE))
		{
			mText[--mTextPosition] = '\0';
		}
	}
}
Exemplo n.º 3
0
void World::FireBullets()
{
	if (Input_IsMousePressed(0))
	{
		const int index0 = myBulletIndex;
		const int index1 = (myBulletIndex + 1) % kMaxBullets;
		const int index2 = (myBulletIndex + 2) % kMaxBullets;
		if (!myBullets[index0].IsActive() &&
			!myBullets[index1].IsActive() &&
			!myBullets[index2].IsActive())
		{
			const Vector2 pos0 = myFighter.GetPosition();
			//const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
			//const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
			const Vector2 vel0(0.0f, -500.0f);
			//const Vector2 vel1(-100.0f, -500.0f);
			//const Vector2 vel2(100.0f, -500.0f);
			myBullets[index0].Fire(pos0, vel0);
			//myBullets[index1].Fire(pos1, vel1);
			//myBullets[index2].Fire(pos2, vel2);
			myBulletIndex = (index2 + 1) % kMaxBullets;
			myFireSound1.Play();
		}
	}

	for (int e = 0; e < kMaxEnemies; ++e)
	{
		if (myEnemies[e] != nullptr && myEnemies[e]->IsActive())
		{
			if(myEnemies[e]->checkfire() == true)
			{
				const int index0 = myEnemyIndex;
				//const int index1 = (myBulletIndex + 1) % kMaxBullets;
				//const int index2 = (myBulletIndex + 2) % kMaxBullets;
				if (!mEnemyBullets1[index0].IsActive() /*&&
					!myBullets[index1].IsActive() &&
					!myBullets[index2].IsActive()*/)
				{
					const Vector2 pos0 = myEnemies[e]->GetPosition();
					//const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
					//const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
					const Vector2 vel0(0.0f, 500.0f);
					//const Vector2 vel1(-100.0f, -500.0f);
					//const Vector2 vel2(100.0f, -500.0f);
					mEnemyBullets1[index0].Fire(pos0, vel0);
					//myBullets[index1].Fire(pos1, vel1);
					//myBullets[index2].Fire(pos2, vel2);
					//myBulletIndex = (index2 + 1) % kMaxBullets;
					myFireSound1.Play();
				}
			}
		}
	}

	for (int e = 0; e < kMaxEnemies; ++e)
	{
		if (myEnemies[e] != nullptr && myEnemies[e]->IsActive())
		{
			if (myEnemies[e]->checkfire2() == true)
			{
				const int index0 = myEnemyIndex;
				const int index1 = (myEnemyIndex + 1) % kMaxBullets;
				const int index2 = (myEnemyIndex + 2) % kMaxBullets;
				if (!mEnemyBullets1[index0].IsActive() &&
					!mEnemyBullets1[index1].IsActive() &&
					!mEnemyBullets1[index2].IsActive())
				{
					const Vector2 pos0 = myEnemies[e]->GetPosition();
					const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
					const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
					const Vector2 vel0(0.0f, 500.0f);
					const Vector2 vel1(-100.0f, 500.0f);
					const Vector2 vel2(100.0f, 500.0f);
					mEnemyBullets1[index0].Fire(pos0, vel0);
					mEnemyBullets1[index1].Fire(pos1, vel1);
					mEnemyBullets1[index2].Fire(pos2, vel2);
					mEnemyBullets1Index = (index2 + 1) % kMaxBullets;
					myFireSound1.Play();
				}
			}
		}
	}

	for (int e = 0; e < kMaxEnemies; ++e)
	{
		if (myEnemies[e] != nullptr && myEnemies[e]->IsActive())
		{
			if (myEnemies[e]->checkfire3() == true)
			{
				const int index0 =  mEnemyBullets2Index;
				//const int index1 = (mCollidableIndex + 1) % kMaxBullets;
				//const int index2 = (mCollidableIndex + 2) % kMaxBullets;
				if (!mEnemyBullets2[index0].IsActive() /*&&
												   !mCollidables[index1].IsActive() &&
												   !mCollidables[index2].IsActive()*/)
				{
					const Vector2 pos0 = myEnemies[e]->GetPosition() + Vector2(-20.0f, 20.0f);
					//const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
					//const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
					const Vector2 vel0(0.0f, 500.0f);
					//const Vector2 vel1(0.0f, -500.0f);
					//const Vector2 vel2(0.0f, -500.0f);
					mEnemyBullets2[index0].Fire(pos0, vel0);
					//mCollidables[index1].Fire(pos1, vel1);
					//mCollidables[index2].Fire(pos2, vel2);
					//mCollidableIndex = (index2 + 1) % kMaxBullets;
					myFireSound2.Play();
				}
			}
		}
	}

	for (int e = 0; e < kMaxEnemies; ++e)
	{
		if (myEnemies[e] != nullptr && myEnemies[e]->IsActive())
		{
			if (myEnemies[e]->checkfire4() == true)
			{
				const int index0 = myEnemyIndex;
				const int index1 = (myEnemyIndex + 1) % kMaxBullets;
				const int index2 = (myEnemyIndex + 2) % kMaxBullets;
				const int index3 = (myEnemyIndex + 3) % kMaxBullets;
				const int index4 = (myEnemyIndex + 4) % kMaxBullets;
				const int index5 = (myEnemyIndex + 5) % kMaxBullets;
				if (!mEnemyBullets1[index0].IsActive() &&
					!mEnemyBullets1[index1].IsActive() &&
					!mEnemyBullets1[index2].IsActive() &&
					!mEnemyBullets1[index3].IsActive() &&
					!mEnemyBullets1[index4].IsActive() &&
					!mEnemyBullets1[index5].IsActive())
				{
					const Vector2 pos0 = myEnemies[e]->GetPosition();
					const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
					const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
					const Vector2 pos3 = pos0 + Vector2(40.0f, 40.0f);
					const Vector2 pos4 = pos0 + Vector2(-40.0f, 40.0f);
					const Vector2 pos5 = pos0 + Vector2(60.0f, 60.0f);
					const Vector2 vel0(0.0f, 500.0f);
					const Vector2 vel1(-100.0f, 500.0f);
					const Vector2 vel2(100.0f, 500.0f);
					const Vector2 vel3(200.0f, 500.0f);
					const Vector2 vel4(300.0f, 500.0f);
					const Vector2 vel5(400.0f, 500.0f);
					mEnemyBullets1[index0].Fire(pos0, vel0);
					mEnemyBullets1[index1].Fire(pos1, vel1);
					mEnemyBullets1[index2].Fire(pos2, vel2);
					mEnemyBullets1[index3].Fire(pos3, vel3);
					mEnemyBullets1[index4].Fire(pos4, vel4);
					mEnemyBullets1[index5].Fire(pos5, vel5);
					mEnemyBullets1Index = (index5 + 1) % kMaxBullets;
					myFireSound1.Play();
				}
			}
		}
	}

	if (Input_IsMousePressed(1))
	{
		const int index0 = mCollidableIndex;
		const int index1 = (mCollidableIndex + 1) % kMaxBullets;
		const int index2 = (mCollidableIndex + 2) % kMaxBullets;
		if (!mCollidables[index0].IsActive() &&
			!mCollidables[index1].IsActive() &&
			!mCollidables[index2].IsActive())
		{
			const Vector2 pos0 = myFighter.GetPosition();
			const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
			const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
			const Vector2 vel0(0.0f, -500.0f);
			const Vector2 vel1(0.0f, -500.0f);
			const Vector2 vel2(0.0f, -500.0f);
			mCollidables[index0].Fire(pos0, vel0);
			mCollidables[index1].Fire(pos1, vel1);
			mCollidables[index2].Fire(pos2, vel2);
			mCollidableIndex = (index2 + 1) % kMaxBullets;
			myFireSound1.Play();
		}
	}

	if (Input_IsMousePressed(2))
	{
		const int index0 = mGenkidamaIndex;
		//const int index1 = (mCollidableIndex + 1) % kMaxBullets;
		//const int index2 = (mCollidableIndex + 2) % kMaxBullets;
		if (!mGenkidama[index0].IsActive() /*&&
			!mCollidables[index1].IsActive() &&
			!mCollidables[index2].IsActive()*/)
		{
			const Vector2 pos0 = myFighter.GetPosition();
			//const Vector2 pos1 = pos0 + Vector2(-20.0f, 20.0f);
			//const Vector2 pos2 = pos0 + Vector2(20.0f, 20.0f);
			const Vector2 vel0(0.0f, -500.0f);
			//const Vector2 vel1(0.0f, -500.0f);
			//const Vector2 vel2(0.0f, -500.0f);
			mGenkidama[index0].Fire(pos0, vel0);
			//mCollidables[index1].Fire(pos1, vel1);
			//mCollidables[index2].Fire(pos2, vel2);
			//mCollidableIndex = (index2 + 1) % kMaxBullets;
			myFireSound2.Play();
		}
	}
}
Exemplo n.º 4
0
void Inventory::Update(float deltaTime) {
	mDragSprite.Update(deltaTime);

	int x = Input_GetMouseScreenX();
	int y = Input_GetMouseScreenY();
	int dragSpriteX = mDragSprite.GetPosition().x;
	int dragSpriteY = mDragSprite.GetPosition().y;
	int width = mDragSprite.GetSpriteWidth();
	int height = mDragSprite.GetSpriteHeight();

	// Check for item use
	if (((x > dragSpriteX) && x < dragSpriteX + width)
			&& (y > dragSpriteY && y < dragSpriteY + height)
			&& mDragSprite.GetVisible()) {
		bool mouseDown = Input_IsMousePressed(Mouse::LBUTTON);
		SVector2 position = mDragSprite.GetPosition();
		float x = Input_GetMouseScreenX() - position.x;
		float y = Input_GetMouseScreenY() - position.y - 32;

		// Exit Button
		if (mouseDown && x > 264 && x < 286 && y < 0) {
			mDragSprite.ToggleVisible();
		}

		int itemSlot = -1;

		// Figure out what item we are selecting
		int xSlot = -1;

		if (x > 27 && x < 70)
			xSlot = 0;
		if (x > 78 && x < 120)
			xSlot = 1;
		if (x > 127 && x < 170)
			xSlot = 2;
		if (x > 178 && x < 218)
			xSlot = 3;
		if (x > 226 && x < 270)
			xSlot = 4;

		int ySlot = -1;

		if (y > -4 && y < 34)
			ySlot = 0;
		if (y > 46 && y < 85)
			ySlot = 1;
		if (y > 93 && y < 135)
			ySlot = 2;
		if (y > 143 && y < 183)
			ySlot = 3;
		if (y > 192 && y < 234)
			ySlot = 4;
		if (y > 242 && y < 282)
			ySlot = 5;

		if (xSlot >= 0 && ySlot >= 0) {
			itemSlot = xSlot + ySlot * 5;
		}

		if (mouseDown) {
			if (itemSlot >= 0 && itemSlot < mItems.size()) {
				mItems[itemSlot]->UseItem(mPlayerInfo, mRaknet);
				mItems.erase(mItems.begin() + itemSlot);
			}
		}

		if (Input_IsMousePressed(Mouse::RBUTTON)) {
			// Delete Item in slot
			if (itemSlot >= 0 && itemSlot < mItems.size()) {
				ItemBase* item = mItems[itemSlot];
				int imageNumber = item->GetImageNumber();
				mItems.erase(mItems.begin() + itemSlot);

				// Let the server know we droped a item
				RakNet::BitStream bsOut;
				bsOut.Write((RakNet::MessageID) ID_DROP_ITEM);

				bsOut.Write(mPlayerInfo.GetMap());
				bsOut.Write(imageNumber);
				bsOut.Write(item->GetItemNumber());
				bsOut.Write(mCharacter.GetTileIndex());

				mRaknet.mPeer->Send(&bsOut, HIGH_PRIORITY, RELIABLE_ORDERED, 0,
						mRaknet.mServerAddress, false);
			}
		}
	}
}
Exemplo n.º 5
0
void Equip::Render() {
	if (mDragSprite.GetVisible()) {
		SVector2 position = mDragSprite.GetPosition();
		float x = Input_GetMouseScreenX() - position.x;
		float y = Input_GetMouseScreenY() - position.y - 32;

		int slot = -1;
		if (Input_IsMousePressed(Mouse::LBUTTON)) {
			// Ring Left
			if (x > 226 && x < 269 && y > 93 && y < 138) {
				slot = ring2;
			}

			// Ring Right
			if (x > 226 && x < 269 && y > 144 && y < 187) {
				slot = ring;
			}

			// Right arm
			if (x > 177 && x < 219 && y > 119 && y < 162) {
				slot = shield;
			}

			// Left arm
			if (x > 78 && x < 118 && y > 120 && y < 163) {
				slot = weapon;
			}

			// Helmet
			if (x > 28 && x < 70 && y > -4 && y < 40) {
				slot = helmet;
			}

			// Armor
			if (x > 28 && x < 70 && y > 94 && y < 137) {
				slot = armor;
			}

			// Boots
			if (x > 28 && x < 70 && y > 143 && y < 189) {
				slot = boots;
			}

			// Necklace
			if (x > 28 && x < 70 && y > 45 && y < 88) {
				slot = necklace;
			}

			if (slot >= 0 && mInventory.GetSpaceLeft() > 0
					&& mPlayerInfo.GetEqiupItemImage(slot) > 0) {
				mSprite[slot].Unload();
				mPlayerInfo.SetEqiupItem(slot, 0, 0);

				RakNet::BitStream bsOut;
				bsOut.Write((RakNet::MessageID) ID_UNEQIUP_ITEM);
				bsOut.Write(slot);
				mRaknet.mPeer->Send(&bsOut, HIGH_PRIORITY, RELIABLE_ORDERED, 0,
						mRaknet.mServerAddress, false);
			}
		}

		mDragSprite.Render();
		mStats.Render();

		mSprite[weapon].SetPosition(position.x + 83, position.y + 155);
		mSprite[shield].SetPosition(position.x + 182, position.y + 155);
		mSprite[helmet].SetPosition(position.x + 32, position.y + 32);
		mSprite[armor].SetPosition(position.x + 32, position.y + 130);
		mSprite[boots].SetPosition(position.x + 32, position.y + 182);
		mSprite[necklace].SetPosition(position.x + 32, position.y + 81);
		mSprite[ring].SetPosition(position.x + 230, position.y + 132);
		mSprite[ring2].SetPosition(position.x + 230, position.y + 182);

		for (int a = 0; a < 8; ++a) {
			if (mPlayerInfo.GetEqiupItemImage(a) > 0) {
				mSprite[a].Render();
			}
		}

		char temp[CHAR_MAX];
		sprintf(temp, "MouseX: %f", x);
		Graphics_DebugText(temp, 5, 225, 0XFF0000);

		sprintf(temp, "MouseY: %f", y);
		Graphics_DebugText(temp, 5, 250, 0XFF0000);

		sprintf(temp, "%s", mPlayerInfo.GetUsername());
		mFont.Print(temp, (int) (position.x + 112.0f),
				(int) (position.y + 23.0f));

		if (mStats.GetVisible()) {
			sprintf(temp, "%d", mPlayerInfo.GetStr());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 288.0f));

			sprintf(temp, "%d", mPlayerInfo.GetDex());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 305.0f));

			sprintf(temp, "%d", mPlayerInfo.GetInt());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 322.0f));

			sprintf(temp, "%d", mPlayerInfo.GetAttack());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 339.0f));

			sprintf(temp, "%d", mPlayerInfo.GetDefence());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 356.0f));

			sprintf(temp, "%d", mPlayerInfo.GetCrit());
			mFont.Print(temp, (int) (position.x + 210.0f),
					(int) (position.y + 373.0f));
		}
	}
}