Exemple #1
0
HRESULT gameStudy::init()
{
	gameNode::init();

	_up = _down = true;

	_count = _warningPlayer = _warningEnemy = 0;
	_playerHp = _enemyHp = 350;
	_playerFt = _enemyFt = 0;

	_ptPlayer.x = WINSIZEX / 7;
	_ptPlayer.y = CENTERY;
	_ptEnemy.x = WINSIZEX / 7 * 6;
	_ptEnemy.y = RND->getFromIntTo(110, WINSIZEY - 80);
	_player = RectMakeCenter(_ptPlayer.x, _ptPlayer.y, 100, 100);
	_enemy = RectMakeCenter(_ptEnemy.x, _ptEnemy.y, 100, 100);

	_bgBar[0] = RectMake(10, 10, 350, 30);
	_bgBar[1] = RectMake(WINSIZEX - 360, 10, 350, 30);
	_bgBar[2] = RectMake(10, 50, 100, 10);
	_bgBar[3] = RectMake(WINSIZEX - 110, 50, 100, 10);

	_enemyHpX = WINSIZEX - 360;
	_enemyFtX = WINSIZEX - 10;

	_hpBar[0] = RectMake(10, 10, _playerHp, 30);			//플레이어
	_fatalBar[0] = RectMake(10, 50, _playerFt, 10);
	
	_hpBar[1] = RectMake(_enemyHpX, 10, _enemyHp, 30);		//적
	_fatalBar[1] = RectMake(_enemyFtX, 50, _enemyFt, 10);

	return S_OK;
}
Exemple #2
0
HRESULT enemy01::init(float x, float y)
{
	//캐릭터 구조체
	_char.img = IMAGEMANAGER->findImage("stand_e01");
	_char.direction = DIRECTION_RIGHT;
	_char.e_state = ENEMY_STATE_STAND;
	_char.kind = KIND_ENEMY;
	_char.hp = 5;
	_char.x = x;
	_char.y = y;
	_char.rc = RectMakeCenter(_char.x, _char.y, _char.img->getFrameWidth(), _char.img->getFrameHeight());

	_char.rcLAtk = RectMakeCenter(_char.x - _char.img->getFrameWidth() / 2, _char.y, 80, 100);
	_char.rcRAtk = RectMakeCenter(_char.x + _char.img->getFrameWidth() / 2, _char.y, 80, 100);

	//상태 bool값, float값 초기화
	_char.isDashLeft = false;
	_char.isDashRight = false;
	_char.dashLeftTime = 0.0f;
	_char.dashRightTime = 0.0f;
	_char.isTornado = false;
	_char.isJump = false;
	_char.isJumpAttack = false;
	_char.isAttack = false;
	_char.removeTime = 0;

	_char.isDrop = false;
	_char.jumpTime = 0.0f;
	_char.jumpSpeed = 4.0f;
	_char.gravity = 0.145f;


	//그림자 구조체
	_shadow.x = _char.x;
	_shadow.y = _char.y + 90;
	_shadow.rc = RectMakeCenter(_shadow.x, _shadow.y, 100, 20);
	_shadow.show = false;
	_shadow.collision = false;
	_tempY = _shadow.y - 90;

	//프레임
	_char.frameX = 0;
	_char.frameY = 1;

	_frameTime = 0.1f;

	_bar = new progressBar;
	_bar->init(190, 90, 255, 20);

	_showInfo = false;

	_char.attackTime = 0.0f;
	_damageCount = 0;
	_char.countDown = 0;
	_char.down = false;
	_downTime = 0.0f;
	die = false;

	return S_OK;
}
Exemple #3
0
void dragon::setRect()
{
	_rc = RectMakeCenter(_x, _y, _image->getFrameWidth(), _image->getFrameHeight());
	_atk = RectMakeCenter(_x - 112, _y + 56, 96, 56);
	_coll = RectMakeCenter(_x + 64, _y, 200, 150);
	_coll2 = RectMakeCenter(_x - 70, _y + 56, 80, 60);
	_aware = RectMakeCenter(_x - _awareW * 0.5, _y, _awareW, _awareH);
}
Exemple #4
0
void enemy01::update(void)
{
	unitManager::update();
	
	if (!die&&_char.hp <= 0)
	{
		SOUNDMANAGER->play("적1주금", 1.0f);
		die = true;
	}

	if (_char.e_state != ENEMY_STATE_HIT) _char.hitTime = TIMEMANAGER->getWorldTime();

	_tempY = _shadow.y - 90;

	_char.rc = RectMakeCenter(_char.x, _char.y, _char.img->getFrameWidth(), _char.img->getFrameHeight());

	_char.rcLAtk = RectMakeCenter(_char.x - _char.img->getFrameWidth() / 4, _char.y-50, 80, 30);
	_char.rcRAtk = RectMakeCenter(_char.x + _char.img->getFrameWidth() / 4, _char.y-50, 80, 30);

	_shadow.x = _char.x;
	if (!_char.isJump&&_char.e_state!=ENEMY_STATE_DIE) _shadow.y = _char.y + 90;
	_shadow.rc = RectMakeCenter(_shadow.x, _shadow.y, 100, 10);

	if (!_showInfo) _currentShowTime = TIMEMANAGER->getWorldTime();

	if (1.0f + _currentShowTime <= TIMEMANAGER->getWorldTime())
	{
		_currentShowTime = TIMEMANAGER->getWorldTime();
		_showInfo = false;
	}

	if (_char.down&&_char.e_state!=ENEMY_STATE_DIE) _char.e_state = ENEMY_STATE_DOWN;

	if (_char.e_state != ENEMY_STATE_DOWN)
	{
		if (_char.x - _targetX > 0) _char.direction = DIRECTION_LEFT;
		else _char.direction = DIRECTION_RIGHT;
	}

	if (_char.e_state == ENEMY_STATE_DIE) _char.frameX = 4;

	//체력바 업데이트
	_bar->setGuage(_char.hp, 5);
	_bar->update();

	//프레임 변경
	frameChange(_char.direction);

	//상태 변경
	if (_char.isControl) enemyState(_char.e_state);
}
Exemple #5
0
HRESULT boxboy::init(int x, int y)
{
	IMAGEMANAGER->addFrameImage("boxboy_attack", "image/enemy/boxboy_attack.bmp", 344, 130, 8, 2, true, 0xff00ff);
	IMAGEMANAGER->addImage("shadow", "image/effect/shadow.bmp", 52, 31, true, 0xff00ff);

	_enemy.charater = new image;
	_enemy.charater->init("image/enemy/boxboy_idle.bmp", 180, 130, 4, 2, true, 0xff00ff);

	_enemy.shadow = IMAGEMANAGER->findImage("shadow");

	_enemy.state = IDLE;
	_enemy.type = BOXBOY;
	_enemy.isRight = false;
	_enemy.pt.x = x;
	_enemy.pt.y = y;
	_enemy.coll = RectMakeCenter(_enemy.pt.x, _enemy.pt.y, _enemy.charater->getFrameWidth(), _enemy.charater->getFrameHeight());
	_enemy.curHp = _enemy.maxHp = 200;
	_isDead = false;

	IMAGEMANAGER->addImage("enemy_bg", "image/ui/enemy_gauge_bg.bmp", 54, 9, true, 0xff00ff);
	IMAGEMANAGER->addImage("enemy_hp", "image/ui/enemy_gauge_hp.bmp", 54, 9, true, 0xff00ff);

	_hpBar = new progressBar;
	_hpBar->init("enemy_bg", "enemy_hp", _enemy.maxHp, _enemy.curHp);
	_hpBar->setBar(_enemy.coll.left, _enemy.coll.top - 5, _enemy.charater->getFrameWidth(), 5);

	_range = 200.f;

	return S_OK;
}
void pixelCollisionTest::update()
{
	if (KEYMANAGER->isStayKeyDown(VK_LEFT))
	{
		_x -= 2.0f;
	}

	if (KEYMANAGER->isStayKeyDown(VK_RIGHT))
	{
		_x += 2.0f;
	}

	_proveY = _y + _ball->getHeight() / 2;

	for (int i = _proveY - 50; i < _proveY + 50; i++)
	{
		COLORREF color = GetPixel(IMAGEMANAGER->findImage("mountain")->getMemDC(), _x, i);

		int r = GetRValue(color);
		int g = GetGValue(color);
		int b = GetBValue(color);

		if (color != RGB(255, 0, 255))
		{
			_y = i - _ball->getHeight() / 2;
			break;
		}
	}


	_rc = RectMakeCenter(_x, _y, _ball->getWidth(), _ball->getHeight());
}
void progressBar::update(void)
{
	gameNode::update();
	_x -= 10;
	
	_rc = RectMakeCenter(_x, _y, 
		_progressBarBottom->getWidth(), 
		_progressBarBottom->getHeight());
}
Exemple #8
0
HRESULT gameStudy::init()
{
	gameNode::init();
	
	int j = 0;
	// 색상 초기화
	for (int i = 0; i < CardNum; i += 2)
	{
		inCardState[i].red = inCardState[i + 1].red = 25 + 25 * (i / 2);
		inCardState[i].green = inCardState[i + 1].green = RND->getInt(256);
		inCardState[i].blue = inCardState[i + 1].blue = 255 - 25 * (i / 2);
	}
	// 카드들 상태( 뒤집히고, 정답이 아닌것 )
	for (int i = 0; i < CardNum; i++)
	{
		inCardState[i].CardOpen = Open;
		inCardState[i].answer = false;
	}
	//카운트, 변수들 0
	_clickCount = _TimeCount = first = second = 0;

	//셔플
	shuffle(inCardState);

	//카드 배치
	for (int i = 0; i < CardNum; i++)
	{
		if ( i < 6 ) inCardState[i]._rc = RectMakeCenter(WINSIZEX / 5 + i * 100, WINSIZEY / 5 + 100 * j, 70, 100);
		else if (i >= 6 && i < 12)
		{
			j = 1;
			inCardState[i]._rc = RectMakeCenter(WINSIZEX / 5 + (i - 6) * 100, WINSIZEY / 5 + 150 * j, 70, 100);
		}
		else if (i >= 12 && i < 18)
		{
			j = 2;
			inCardState[i]._rc = RectMakeCenter(WINSIZEX / 5 + (i - 12) * 100, WINSIZEY / 5 + 150 * j, 70, 100);
		}
	}
	return S_OK;
}
Exemple #9
0
void spaceShip::update(enemy** enemy)
{
	_enemy = enemy;
	_count++;

	if (KEYMANAGER->isStayKeyDown(VK_LEFT))
	{
		if(_x - _ship->getFrameWidth()/2 > 0)
			_x -= 5.f;
	}
	if (KEYMANAGER->isStayKeyDown(VK_RIGHT))
	{
		if(_x + _ship->getFrameWidth()/2 < WINSIZEX)
			_x += 5.f;
	}

	if (KEYMANAGER->isStayKeyDown(VK_UP))
	{
		if(_y - _ship->getFrameHeight()/2 > 0)
			_y -= 5.f;
	}
		
	if (KEYMANAGER->isStayKeyDown(VK_DOWN))
	{
		if(_y + _ship->getFrameHeight()/2 < WINSIZEY)
		_y += 5.f;
	}

	if (KEYMANAGER->isOnceKeyDown(VK_SPACE))
	{
		if (!_isDead)
		{
			_missile->fire(_ship->getX() + _ship->getFrameWidth() / 2,
				_ship->getY() - _ship->getFrameHeight());
		}
	}

	//rect 갱신
	_rcShip = RectMakeCenter(_x, _y,
		_ship->getFrameWidth(), _ship->getFrameHeight());

	//image의 위치를 rect에 맞추자
	_ship->setX(_rcShip.left);
	_ship->setY(_rcShip.top);

	setFrame();

	attack();

	collisionEnemy();

	_missile->update();
}
Exemple #10
0
void enemy::setIsDead(bool isDead)
{
	_isDead = isDead;
	_x = _initX;
	_y = _initY;
	_rc = RectMakeCenter(_x, _y, _image->getFrameWidth(), _image->getFrameHeight());

	_state = ES_IDLE;
	_curFrameX = 0;

	_life = _initLife;
}
Exemple #11
0
HRESULT enemy::init(int x, int y)
{
	_enemy.image = new image;
	_enemy.image->init("image/monster_stand.bmp", 53, 136, 1, 2, true, 0xff00ff);
	_enemy.state = STAND;
	_enemy.x = x;
	_enemy.y = y;
	_enemy.rc = RectMakeCenter(_enemy.x, _enemy.y,
		_enemy.image->getFrameWidth(), _enemy.image->getFrameHeight());

	return S_OK;
}
Exemple #12
0
HRESULT selectScene::init()
{
	IMAGEMANAGER->addFrameImage("button", "image/button.bmp", 64, 32, 2, 1, true, 0xff00ff);
	IMAGEMANAGER->addFrameImage("select", "image/select.bmp", 42, 21, 1, 1, false, false);

	_decreaseAngle = new button;
	_decreaseAngle->init("button", CENTERX - 100, CENTERY + 100, PointMake(0, 0), PointMake(0, 0), onDcrsAngleButton);
	_increaseAngle = new button;
	_increaseAngle->init("button", CENTERX + 100, CENTERY + 100, PointMake(1, 0), PointMake(1, 0), onIncrsAngleButton);

	_decreaseMaxSpd = new button;
	_decreaseMaxSpd->init("button", CENTERX - 100, CENTERY + 150, PointMake(0, 0), PointMake(0, 0), onDcrsMaxSpdButton);
	_increaseMaxSpd = new button;
	_increaseMaxSpd->init("button", CENTERX + 100, CENTERY + 150, PointMake(1, 0), PointMake(1, 0), onIncrsMaxSpdButton);

	_select = new button;
	_select->init("select", CENTERX, CENTERY + 200, PointMake(0, 0), PointMake(0, 0), onSelectButton);

	_battle.x = WINSIZEX / 4;
	_carrier.x = WINSIZEX / 4 * 2;
	_phoenix.x = WINSIZEX / 4 * 3;
	_battle.y = _carrier.y = _phoenix.y = CENTERY;

	_battle.angle = _carrier.angle = _phoenix.angle = 0.f;
	_battle.maxSpd = _carrier.maxSpd = _phoenix.maxSpd = 0.f;

	_battle.image = IMAGEMANAGER->findImage("battle");
	_carrier.image = IMAGEMANAGER->findImage("carrier");
	_phoenix.image = IMAGEMANAGER->findImage("phoenix");

	_battle.rc = RectMakeCenter(_battle.x, _battle.y, _battle.image->getFrameWidth(), _battle.image->getFrameHeight());
	_carrier.rc = RectMakeCenter(_carrier.x, _carrier.y, _carrier.image->getFrameWidth(), _carrier.image->getFrameHeight());
	_phoenix.rc = RectMakeCenter(_phoenix.x, _phoenix.y, _phoenix.image->getFrameWidth(), _phoenix.image->getFrameHeight());

	_battle.image->setFrameX(_battle.angle / PI8);
	_carrier.image->setFrameX(_carrier.angle / PI16);
	_phoenix.image->setFrameX(_phoenix.angle / (PI / 13));

	return S_OK;
}
Exemple #13
0
//적 초기화 / 이미지 + 위치
HRESULT enemy::init(const char* imageName, POINT position)
{
	_isBoss = false;

	_currentFrameX = _currentFrameY = 0;
	_count = 0;
	_fireCount = 0;
	_rndFireCount = RND->getFromIntTo(1, 1000);

	//const 포인터 변수 : 이미지 이름으로 이미지를 찾아와서 저장
	_imageName = IMAGEMANAGER->findImage(imageName);
	_rc = RectMakeCenter(position.x, position.y, _imageName->getFrameWidth(), _imageName->getFrameHeight());

	return S_OK;
}
Exemple #14
0
void player1::attack()
{
	if (_isDamaged == false && _isDead == false)
	{
		if (_action == JUMP && _downwardThrust == true)
		{
			_attackRC = RectMakeCenter(_x + (_direction * 2 - 1), _y, 8, 9);
		}
		else if (_action == ATTACK)
		{
			switch (_frameX)
			{
			case(0):
				_attackRC = RectMakeCenter(_x + (-9) * (_direction * 2 - 1), _y - 4, 10, 8);
				break;
			case(1):
				_attackRC = RectMakeCenter(_x + (-27) * (_direction * 2 - 1), _y - 11, 10, 8);
				break;
			case(2):
				_attackRC = RectMakeCenter(_x + (-16) * (_direction * 2 - 1), _y - 22, 10, 8);
				break;
			case(3):
				_attackRC = RectMakeCenter(_x + (13) * (_direction * 2 - 1), _y - 24, 10, 8);
				break;
			}
		}
		else
		{
			_attackRC = RectMake(0, 0, 0, 0);
		}
	}
	else
	{
		_attackRC = RectMake(0, 0, 0, 0);
	}
}
Exemple #15
0
HRESULT boss::init(const char * imageName, POINT position)
{
	_isBoss = true;

	_pattern = PATTERN_1;

	_currentFrameX = _currentFrameY = 0;
	_count = 0;

	//const 포인터 변수 : 이미지 이름으로 이미지를 찾아와서 저장
	_imageName = IMAGEMANAGER->findImage(imageName);
	_rc = RectMakeCenter(position.x, position.y, _imageName->getFrameWidth(), _imageName->getFrameHeight());

	return S_OK;
}
HRESULT pixelCollisionTest::init()
{
	IMAGEMANAGER->addImage("mountain", "image/mountain.bmp", 922, 551, true, RGB(255, 0, 255));

	_ball = IMAGEMANAGER->addImage("ball", "image/ball.bmp", 60, 60, true, 0xff00ff);

	_x = CENTERX - 100;
	_y = CENTERY + 80;

	_rc = RectMakeCenter(_x, _y, _ball->getWidth(), _ball->getHeight());

	_proveY = _y + _ball->getHeight() / 2;

	return S_OK;
}
HRESULT progressBar::init(int x, int y, int width, int height)
{
	gameNode::init();

	_x = x;
	_y = y;

	_rc = RectMakeCenter(_x, _y, width, height);

	_progressBarBottom = IMAGEMANAGER->addImage("hpBarBottom", "hpBarBottom.bmp", 53, 4, true, RGB(255, 0, 255));
	_progressBarTop = IMAGEMANAGER->addImage("hpBarTop", "hpBarTop.bmp", 53, 4, true, RGB(255, 0, 255));

	_width = _progressBarTop->getWidth();

	return S_OK;
}
Exemple #18
0
HRESULT spaceShip::init()
{
	_ship = IMAGEMANAGER->addFrameImage("dragon", "dragon_fly.bmp", 120, 44, 2, 1, true, 0x00ff00);

	_x = CENTERX;
	_y = WINSIZEY / 5 * 4;

	_rcShip = RectMakeCenter(_x, _y,
		_ship->getFrameWidth(), _ship->getFrameHeight());

	_ship->setX(_rcShip.left);
	_ship->setY(_rcShip.top);

	_isDead = false;
	_count = _index = 0;

	_missile = new missile;
	_missile->init(MISSILEMAX);

	return S_OK;
}
Exemple #19
0
void boxboy::move()
{
	if (MY_UTIL::getDistance(_enemy.pt.x, _enemy.pt.y, _playerX, _playerY) < _range)
	{
		if (_enemy.state != ATTACK)
			_enemy.state = RUN;

		//플레이어 쪽으로 이동
		if (_enemy.pt.x > _playerX + 40)
		{
			if (_enemy.isRight)
				_enemy.isRight = false;
			_enemy.pt.x -= 2;
		}
		else if (_enemy.pt.x < _playerX - 40)
		{
			if (!_enemy.isRight)
				_enemy.isRight = true;
			_enemy.pt.x += 2;
		}
		else if (_enemy.pt.y > _playerY + 2)
		{
			_enemy.pt.y -= 2;
		}
		else if (_enemy.pt.y < _playerY - 2)
		{
			_enemy.pt.y += 2;
		}
	}
	else
	{
		_enemy.state = IDLE;
	}
	
	_enemy.coll = RectMakeCenter(_enemy.pt.x, _enemy.pt.y, _enemy.charater->getFrameWidth(), _enemy.charater->getFrameHeight());
}
Exemple #20
0
void boxboy::attack()
{
	if (_enemy.pt.x < _playerX + 50 && _enemy.pt.x > _playerX - 50
		&& _enemy.pt.y < _playerY + 5 && _enemy.pt.y > _playerY - 5
		&& _enemy.state != ATTACK)
	{
		_enemy.state = ATTACK;
		if (_enemy.pt.x > _playerX)
		{
			_enemy.isRight = false;
			_curFrameX = 7;
		}
		else if (_enemy.pt.x < _playerX)
		{
			_enemy.isRight = true;
			_curFrameX = 0;
		}

		int width = IMAGEMANAGER->findImage("boxboy_attack")->getFrameWidth();
		int height = IMAGEMANAGER->findImage("boxboy_attack")->getFrameHeight();
		_enemy.coll = RectMakeCenter(_enemy.pt.x, _enemy.pt.y, width, height);
		collision();
	}
}
Exemple #21
0
void gameStudy::update()
{
	_count++;

	if (KEYMANAGER->isStayKeyDown(VK_UP))
	{
		if(_up)
			_ptPlayer.y -= 5;
	}
	if (KEYMANAGER->isStayKeyDown(VK_DOWN))
	{
		if (_down)
			_ptPlayer.y += 5;
	}
	if (KEYMANAGER->isOnceKeyDown(VK_SPACE))
	{	//총알 생성
		_vBullet.push_back(RectMakeCenter(_ptPlayer.x + 60, _ptPlayer.y, 10, 10));
	}

	//적이 공격하는 범위
	if (_ptEnemy.y < _ptPlayer.y + 50 && _ptEnemy.y > _ptPlayer.y - 50)
	{
		//0.5초에 한번 총쏴라
		if(_count % 10 == 0)
			_vEBullet.push_back(RectMakeCenter(_ptEnemy.x - 55, _ptEnemy.y, 10, 10));
	}

	//이동 범위를 제한시키자
	if (_player.top < 60)
	{
		_up = false;
		_down = true;
	}
	else if (_player.bottom > WINSIZEY - 30)
	{
		_down = false;
		_up = true;
	}
	else if (_player.top > 60 && _player.bottom < WINSIZEY - 30)
	{
		_up = true;
		_down = true;
	}

	if (_ptPlayer.y < _ptEnemy.y)		//플레이어가 윗쪽에 있다면
	{
		_ptEnemy.y -= 3;
	}
	else if (_ptPlayer.y > _ptEnemy.y)	//플레이어가 아랫쪽에 있다면
	{
		_ptEnemy.y += 3;
	}

	//플레이어 총알
	for (_viBullet = _vBullet.begin(); _viBullet < _vBullet.end();)
	{
		_viBullet->left += 5;
		_viBullet->right += 5;

		//총알이 밖으로 화면 밖으로 나가면
		if (_viBullet->left > WINSIZEX)
		{	//총알을 지우자
			_viBullet = _vBullet.erase(_viBullet);
		}
		//총알이 적에게 맞으면
		else if (IntersectRect(&RectMake(0, 0, 0, 0), &(*_viBullet), &_enemy))
		{
			//적의 HP를 깎자
			_enemyHpX += 10;		//바 시작 위치 변경
			_enemyHp -= 10;			//바 크기 변경
			_viBullet = _vBullet.erase(_viBullet);
			_playerFt += 10;
		}
		else
		{
			_viBullet++;			//왜 계속 여기서 걸리니?
		}
	}
	
	//적 총알
	for (_viEBullet = _vEBullet.begin(); _viEBullet < _vEBullet.end();)
	{
		_viEBullet->left -= 5;
		_viEBullet->right -= 5;

		if (_viEBullet->right < 0)
		{
			_viEBullet = _vEBullet.erase(_viEBullet);
		}
		//총알이 플레이어에게 맞으면
		else if (IntersectRect(&RectMake(0, 0, 0, 0), &(*_viEBullet), &_player))
		{
			//플레이어의 HP를 깎자
			_playerHp -= 10;
			_viEBullet = _vEBullet.erase(_viEBullet);
			_enemyFt += 25;		//스킬 게이지 증가
			_enemyFtX -= 25;
		}
		else
		{
			_viEBullet++;
		}
	}

	//플레이어의 레이저 게이지가 꽉 차면
	if (_playerFt >= 100)
	{
		_playerFt = 0;
		//_laser[0] = RectMakeCenter(_ptPlayer.x, _ptPlayer.y, 500, 10);
	}

	//적의 레이저 게이지 꽉 차면
	if (_enemyFt >= 100)
	{
		_enemyFt = 0;
		_enemyFtX = WINSIZEX - 10;
	}


	//플레이어 HP 상태
	if (_playerHp < 350 * 0.5)
		_warningPlayer = 1;
	if(_playerHp < 350 * 0.1)
		_warningPlayer = 2;
	if (_playerHp <= 0)
	{
		release();
		MessageBox(_hWnd, "Lose!!!", "Result", MB_OK);
	}
	
	//적 HP 상태
	if (_enemyHp < 350 * 0.5)
		_warningEnemy = 1;
	if (_enemyHp < 350 * 0.1)
		_warningEnemy = 2;
	if (_enemyHp <= 0)
	{
		release();
		MessageBox(_hWnd, "Won!!!", "Result", MB_OK);
	}


	//오브젝트 다시 그리자
	_player = RectMakeCenter(_ptPlayer.x, _ptPlayer.y, 100, 100);
	_enemy = RectMakeCenter(_ptEnemy.x, _ptEnemy.y, 100, 100);
	_hpBar[0] = RectMake(10, 10, _playerHp, 30);			
	_hpBar[1] = RectMake(_enemyHpX, 10, _enemyHp, 30);
	_fatalBar[0] = RectMake(10, 50, _playerFt, 10);
	_fatalBar[1] = RectMake(_enemyFtX, 50, _enemyFt, 10);

	gameNode::update();
}
void progressBar::update()									  
{
	_rcProgress = RectMakeCenter(_x, _y, _progressBarTop->getWidth(), _progressBarTop->getHeight());
}
Exemple #23
0
void skillBase::reRect()
{
	_rc = RectMakeCenter(_x, _y, _imgWidth, _imgHeight);
}
Exemple #24
0
HRESULT BardKnight::init()
{
	npcBase::init();
	//==========가격 세팅 변수===========//
	_bgmPrice = 100;								//브금체인지 가격
	_effectSoundPrice = 500;						//이펙트사운드 체인지 가격


	//==========팔렸는지 확인용 변수들==========//
	_stock = 0;										//몇번이나 상점에서 구매했는지 확인 변수
	_isSellBgm = false;								//브금 팔렸는지
	_isSellEffectSound = false;						//이펙트 사운드 팔렸는지


	//=========마더클래스로부터 가져온 변수들 초기화 ==============//

	_imgKeyString = "BardKnightIDLE";				//이미지 매니저에 등록할 이미지 키갑
	_imgFileName = "./image/npc/bardKnight.bmp";		//이미지 파일 이름(경로 포함)`

	_img = IMAGEMANAGER->addFrameImage(_imgKeyString, _imgFileName, 1066, 42, 26, 1, true, RGB(255, 0, 255), false);		// NPC 이미지
	IMAGEMANAGER->addFrameImage("BardKnightJump", "./image/npc/bardKnight_jump.bmp", 798, 52, 14, 1, true, RGB(255, 0, 255), false);
	IMAGEMANAGER->addFrameImage("BardKnightPlaying", "./image/npc/bardKnight_playing.bmp", 720, 39, 16, 1, true, RGB(255, 0, 255), false);

	


	_x = 400 / 2;
	_y = 410 / 2;

	_img->setCenter(_x, _y);						//이미지 중점좌표로 중점좌표 잡는다. 
	_width = _img->getFrameWidth();					//가로크기
	_height = _img->getFrameHeight();				//세로크기
	_rc = RectMakeCenter(_x, _y, _width, _height);	//상점NPC 렉트
	_npcType = BARDKNIGHT;							//NPC타입

	_isCollisionNpc = false;						//플레이어와 충돌했는가? true : 그렇다, false : 아니다
	_isAppear = true;								//기본상태로 맵에서 등장하지 않는다.

	int arrIDLE1[26];
	for (int i = 0; i < 26; ++i)
	{
		arrIDLE1[i] = i;
	}										
	KEYANIMANAGER->addArrayFrameAnimation("바드나이트아이들", "BardKnightIDLE", arrIDLE1, 26, 6, true);


	int arrJump[14];
	for (int i = 0; i < 14; ++i)
	{
		arrJump[i] = i;
	}
	KEYANIMANAGER->addArrayFrameAnimation("바드나이트점프", "BardKnightJump", arrJump, 14, 6, true);
	
	//테스트용
	_anim = KEYANIMANAGER->findAnimation("바드나이트아이들");		//NPC 애니메이션
	_anim2 = KEYANIMANAGER->findAnimation("바드나이트점프");		//NPC 애니메이션
	KEYANIMANAGER->start("바드나이트아이들");
	KEYANIMANAGER->start("바드나이트점프");
	

	_testScript = new image;
	_testScript = IMAGEMANAGER->addImage("scriptWindow", "./image/UI/Script_window.bmp", 0, 0, 800, 96, true, RGB(255, 0, 255));
	DIALOGUEMANAGER->setScriptWindow(_testScript);
	
	

	//_testScript1 = new image;
	//_testScript1 = IMAGEMANAGER->addImage("scriptWindow", "./image/UI/Script_window.bmp", 0, 0, 800, 96, true, RGB(255, 0, 255));
	//DIALOGUEMANAGER->setScript("사려면 O키를 안사려면 K키를누르게",255,255,255);
	
	_isCollisionPlayer = false;
	
	_vDialog.push_back("힘세고 좋은 아침, 묻는다면 나는 바드나이트 배경음악을 바꾸겠나?"); //0번
	_vDialog.push_back("바꾸려면 O키를 안바꾸려면 P키를누르게");//1번
	_vDialog.push_back("배경음악을 바꿔주겠네");//2번
	
	//분기선택
	//_vDialog2.push_back("배경음악을 바꾸고 싶으면 언제든 말을 걸도록 하게");//0번
	

	_idx = 0;
	_isChange = false;
	_textOut = false;
	_isReturn = false;
	return S_OK;

	
}
Exemple #25
0
void enemy::move()
{
	_enemy.rc = RectMakeCenter(_enemy.x, _enemy.y,
		_enemy.image->getFrameWidth(), _enemy.image->getFrameHeight());
}
Exemple #26
0
void enemy::setRect()
{
	_rc = RectMakeCenter(_x, _y, _image->getFrameWidth(), _image->getFrameHeight());
}
Exemple #27
0
void customize_Scene::Scene_Update(float timDelta)
{
	pMainCamera->SetWorldPosition(_CameraTrans->GetWorldPosition() + _CameraTrans->GetRight() * z + _CameraTrans->GetUp() * y);
	pMainCamera->LookPosition(D3DXVECTOR3(0, LookY, 0));


	if (z < Z)
	{
		z += 0.1;
	}
	if (z > Z)
	{
		z -= 0.1;
	}

	if (y < Y)
	{
		y += 0.1;
	}
	if (y > Y)
	{
		y -= 0.1;
	}


	_BodyAni->Update(timDelta);
	_HandAni->Update(timDelta);
	_FootAni->Update(timDelta);

	if (KEYMANAGER->IsOnceDown(VK_RETURN))
	{
		if (HairNum == -1)
		{
			SCENEMANAGER->FindScece("game")->TempHair = "없음";
		}
		else
		{
			SCENEMANAGER->FindScece("game")->TempHair = _vHair[HairNum]->filePath;
		}
		SCENEMANAGER->FindScece("game")->TempHead = _vHead[HeadNum]->filePath;
		SCENEMANAGER->FindScece("game")->TempColor = _HairColor;

		for (int i = 0; i < _vHead.size(); i++)
		{
			if (i == HeadNum)continue;
			RESOURCE_SKINNEDXMESH->RemoveResource(_vHead[i]->filePath);
		}
		if (HairNum == -1)
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		else
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				if (i == HairNum)continue;
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		//RESOURCE_TEXTURE->ClearResource();
		SCENEMANAGER->ChangeScene("game");
	}

	if (KEYMANAGER->IsStayDown('W'))
	{
		if (Y < 10)
		{
			Y += 0.1; 
			LookY += 0.1;
		}
	}
	if (KEYMANAGER->IsStayDown('S'))
	{
		if (Y > -10)
		{
			Y -= 0.1;
			LookY -= 0.1;
		}
	}
	if (KEYMANAGER->IsStayDown('A'))
	{
		_CameraTrans->RotateSelf(0, 0.01, 0);
	}
	if (KEYMANAGER->IsStayDown('D'))
	{
		_CameraTrans->RotateSelf(0, -0.01, 0);
	}

	if (KEYMANAGER->IsOnceDown(VK_LBUTTON))
	{
		MouseClick();
	}
	if (KEYMANAGER->IsOnceUp(VK_LBUTTON))
	{
		R = G = B = A = false;
	}

	if (R)
	{
		_ColorBarControlR.x = GetMousePos().x;
		if (_ColorBarControlR.x < 993)
		{
			_ColorBarControlR.x = 995;
		}
		if (_ColorBarControlR.x > 1180)
		{
			_ColorBarControlR.x = 1180;
		}
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
	}
	if (G)
	{
		_ColorBarControlG.x = GetMousePos().x;
		if (_ColorBarControlG.x < 993)
		{
			_ColorBarControlG.x = 995;
		}
		if (_ColorBarControlG.x > 1180)
		{
			_ColorBarControlG.x = 1180;
		}
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_G = _ColorBarControlG.x - 995;
	}
	if (B)
	{
		_ColorBarControlB.x = GetMousePos().x;
		if (_ColorBarControlB.x < 993)
		{
			_ColorBarControlB.x = 995;
		}
		if (_ColorBarControlB.x > 1180)
		{
			_ColorBarControlB.x = 1180;
		}
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_B = _ColorBarControlB.x - 995;
	}
	if (A)
	{
		_ColorBarControlA.x = GetMousePos().x;
		if (_ColorBarControlA.x < 993)
		{
			_ColorBarControlA.x = 995;
		}
		if (_ColorBarControlA.x > 1180)
		{
			_ColorBarControlA.x = 1180;
		}
		_ColorBarControlA.rc = RectMakeCenter(_ColorBarControlA.x, _ColorBarControlA.y, 32, 32);
		_A = _ColorBarControlA.x - 995;
	}

	SetTrans();

	//int screenCenterX;
	//int screenCenterY;

	if (KEYMANAGER->IsOnceDown(VK_RBUTTON))
	{
		//screenCenterX = WINSIZEX / 2;
		//screenCenterY = WINSIZEY / 2;

		//다시 마우스 위치를 센터로...
		tempPt = GetMousePos();
		SetMousePos(WINSIZEX / 2, WINSIZEY / 2);
		ShowCursor(false);
	}
	if (KEYMANAGER->IsOnceUp(VK_RBUTTON))
	{
		ShowCursor(true);
		SetMousePos(tempPt.x, tempPt.y);
	}
	POINT mousePos = GetMousePos();
	if (KEYMANAGER->IsStayDown(VK_RBUTTON))
	{

		float MoveX = mousePos.x - WINSIZEX / 2;
		float MoveY = mousePos.y - WINSIZEY / 2;

		_CameraTrans->RotateSelf(0, MoveX / 30, 0);
		LookY += MoveY / 100;
		SetMousePos(WINSIZEX / 2, WINSIZEY / 2);
	}


	//if (PtInRect(&_MainInfo.rc, GetMousePos()))
	//{
	//	_CameraTrans->RotateSelf(0, 0.01, 0);
	//}
	//pMainCamera->DefaultControl(timDelta);

	char str[36];
	sprintf(str, "X :%d Y :%d x:%.1f y:%.1f", mousePos.x, mousePos.y, _MainInfo.x - mousePos.x, _MainInfo.y - mousePos.y);
	//LOGMANAGER->AddLog(str);

	if (_BodyAni->GetAniPlayFactor() > 0.945)
		Ani = false;

	_HairColor = D3DXVECTOR4(_R / 185, _G / 185, _B / 185, _A / 185);

	sprintf(str, "R%.2f G%.2f B%.2f A%.2f", _HairColor.x, _HairColor.y, _HairColor.z, _HairColor.w);
	LOGMANAGER->AddLog(str);
}
Exemple #28
0
HRESULT customize_Scene::Scene_Init()
{
	_Img = RESOURCE_TEXTURE->GetResource("../Resources/OurModel/Texture/customize.png");
	_rc = { 0, 0, 1024, 1024 };
	_x = WINSIZEX / 2;
	_y = WINSIZEY / 2;

	SCENEMANAGER->fProgress = 0.0f;
	SCENEMANAGER->fString = "자아 시작한다 !";

	D3DXMATRIXA16 matCorrection;
	D3DXMatrixScaling(&matCorrection, 0.1f, 0.1f, 0.1f);
	D3DXMATRIXA16 matR;
	D3DXMatrixRotationY(&matR, 90.0f*ONE_RAD);
	matR *= matCorrection;

	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face1.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fProgress = 15;
	SCENEMANAGER->fString = "하나 성공";

	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face2.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fProgress = 15;
	SCENEMANAGER->fString = "두개 성공";

	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face3.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "3 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face4.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "4 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face5.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "5 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face6.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "6 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face7.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "7 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face8.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "8 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face9.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "9 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face10.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "10 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face11.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "11 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face12.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "12 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face13.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);

	SCENEMANAGER->fString = "13 성공";
	_HeadInfo = new SkinInfo;
	_HeadInfo->SkinnedAni = new cSkinnedAnimation();
	_HeadInfo->filePath = "../Resources/OurModel/Player/Head/Face14.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HeadInfo->filePath, &matR);
	_HeadInfo->SkinnedAni->Init(Skinned);
	_vHead.push_back(_HeadInfo);


	SCENEMANAGER->fProgress = 50;
	SCENEMANAGER->fString = "얼굴 다 불렀다아!";

	////////////////////////////////////////////////////////////////////////////////////////////////머리끝 
	////////////////////////////////////////////////////////////////////////////////////////////////헤어시작

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair1.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair2.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair3.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair4.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair5.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair6.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair7.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair8.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair9.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair10.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair11.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair12.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair13.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair14.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair15.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);

	_HairInfo = new SkinInfo;
	_HairInfo->SkinnedAni = new cSkinnedAnimation();
	_HairInfo->filePath = "../Resources/OurModel/Player/Hair/Hair16.X";
	Skinned = RESOURCE_SKINNEDXMESH->GetResource(_HairInfo->filePath, &matR);
	_HairInfo->SkinnedAni->Init(Skinned);
	_vHair.push_back(_HairInfo);
	
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face2.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face3.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face4.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face5.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face6.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face7.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face8.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face9.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face10.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face11.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face12.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face13.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Head/Face14.X", &matR);


	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair1.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair2.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair3.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair4.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair5.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair6.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair7.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair8.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair9.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair10.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair11.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair12.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair13.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair14.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair15.X", &matR);
	//RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Hair/Hair16.X", &matR);

	SCENEMANAGER->fProgress = 100;
	SCENEMANAGER->fString = "머리도 다 불렀따아!";

	cLight_Direction* pLight = new cLight_Direction();
	pLight->pTransform->LookPosition(D3DXVECTOR3(-1, 0, 0));
	pLight->Color = D3DXCOLOR(1, 1, 1, 1);
	pLight->Intensity = 1.0f;
	cLight_Direction* pLight2 = new cLight_Direction();
	pLight2->pTransform->LookPosition(D3DXVECTOR3(1, 0, 0));
	pLight2->Color = D3DXCOLOR(1, 1, 1, 1);
	pLight2->Intensity = 1.0f;
	cLight_Direction* pLight3 = new cLight_Direction();
	pLight3->pTransform->LookPosition(D3DXVECTOR3(1, 0, -1));
	pLight3->Color = D3DXCOLOR(1, 1, 1, 1);
	pLight3->Intensity = 1.0f;
	cLight_Direction* pLight4 = new cLight_Direction();
	pLight4->pTransform->LookPosition(D3DXVECTOR3(0, 0, 1));
	pLight4->Color = D3DXCOLOR(1, 1, 1, 1);
	pLight4->Intensity = 1.0f;
	//cLight_Direction* pLight5 = new cLight_Direction();
	//pLight5->pTransform->LookPosition(D3DXVECTOR3(1, -1, 0));
	//pLight5->Color = D3DXCOLOR(1, 1, 1, 1);
	//pLight5->Intensity = 1.0f;

	lights.push_back(pLight);
	lights.push_back(pLight2);
	lights.push_back(pLight3);
	lights.push_back(pLight4);
	//lights.push_back(pLight5);
	_HairTrans = new cTransform;
	_HeadTrans = new cTransform;
	_BodyTrans = new cTransform;
	_HandTrans = new cTransform;
	_FootTrans = new cTransform;
	_MainTrans = new cTransform;
	_MainTrans->SetWorldPosition(0, 0, 0);

	_BodyAni = new cSkinnedAnimation;
	_HandAni = new cSkinnedAnimation;
	_FootAni = new cSkinnedAnimation;
	Skinned = RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Naked/body.X", &matCorrection);
	_BodyAni->Init(Skinned);
	Skinned = RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Naked/hand.X", &matCorrection);
	_HandAni->Init(Skinned);
	Skinned = RESOURCE_SKINNEDXMESH->GetResource("../Resources/OurModel/Player/Naked/foot.X", &matCorrection);
	_FootAni->Init(Skinned);

	HairNum = -1;
	HeadNum = 0;

	//_bodySkin->AddBoneTransform("Bip01-Neck", _headTrans);
	//_headSkin->AddBoneTransform("Dummy_Face", _hairTrans);

	_BodyAni->AddBoneTransform("Bip01-Neck", _HeadTrans);
	//_HeadTrans->SetLocalPosition(D3DXVECTOR3(-10, 0, 0));
	//_HeadTrans->AddChild(_HairTrans);
	_vHead[HeadNum]->SkinnedAni->AddBoneTransform("Dummy_Face", _HairTrans);
	
	_MainTrans->AddChild(_HandTrans);
	_MainTrans->AddChild(_FootTrans);
	//헤드스킨은 Bip01-Neck
	//헤어스킨은 Dummy_Face
	Push = false;
	Push2 = false;

	_BodyAni->Play("Wait", 0);
	_HandAni->Play("Wait", 0);
	_FootAni->Play("Wait", 0);

	this->SetEnvironment("../Resources/TextureCUBE/desert2.dds");
	Z = 6;
	Y = 4.5;
	z = 6;
	y = 4.5;
	LookY = 2;

	_CameraTrans = new cTransform;
	_CameraTrans->SetWorldPosition(0, 0, 0);
	_CameraTrans->AddChild(pMainCamera);
	
	pMainCamera->SetWorldPosition(_CameraTrans->GetWorldPosition() + _CameraTrans->GetRight() * Z + _CameraTrans->GetUp() * Y);
	pMainCamera->LookPosition(_CameraTrans->GetWorldPosition() + D3DXVECTOR3(0, LookY, 0));

	//_MainInfo;
	//_HairLeft;
	//_HairRihgt;
	//_HeadLeft;
	//_HeadRight;
	//_Ok;
	DXFONTMANAGER->AddStyle(Device, "홍체", "돋움체", 15);
	DXFONTMANAGER->AddStyle(Device, "홍체2", "돋움체", 12);

	_MainInfo.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/커스텀마이징.png");
	_MainInfo.x = 1088;
	_MainInfo.y = WINSIZEY / 2;
	_MainInfo.rc = RectMakeCenter(_MainInfo.x, _MainInfo.y, 384, 768);

	_HairLeft.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/buttonM.png");
	_HairLeft.x = 1008;
	_HairLeft.y = 160;
	_HairLeft.rc = RectMakeCenter(_HairLeft.x, _HairLeft.y, 32, 32);

	_HairRight.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/buttonP.png");
	_HairRight.x = 1168;
	_HairRight.y = 160;
	_HairRight.rc = RectMakeCenter(_HairRight.x, _HairRight.y, 32, 32);

	_HeadLeft.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/buttonM.png");
	_HeadLeft.x = 1008;
	_HeadLeft.y = 260;
	_HeadLeft.rc = RectMakeCenter(_HeadLeft.x, _HeadLeft.y, 32, 32);

	_HeadRight.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/buttonP.png");
	_HeadRight.x = 1168;
	_HeadRight.y = 260;
	_HeadRight.rc = RectMakeCenter(_HeadRight.x, _HeadRight.y, 32, 32);

	_CameraFace.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/Face.png");
	_CameraFace.x = 1008;
	_CameraFace.y = 400;
	_CameraFace.rc = RectMakeCenter(_CameraFace.x, _CameraFace.y, 64, 64);
	
	_CameraBody.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/Body.png");
	_CameraBody.x = 1168;
	_CameraBody.y = 400;
	_CameraBody.rc = RectMakeCenter(_CameraBody.x, _CameraBody.y, 64, 64);
	
	_ColorBarR.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/프로그레스바/down1.png");
	_ColorBarR.x = 1088;
	_ColorBarR.y = 510;
	_ColorBarR.rc = RectMakeCenter(_ColorBarR.x, _ColorBarR.y, 256, 32);

	_ColorBarG.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/프로그레스바/down1.png");
	_ColorBarG.x = 1088;
	_ColorBarG.y = 540;
	_ColorBarG.rc = RectMakeCenter(_ColorBarG.x, _ColorBarG.y, 256, 32);

	_ColorBarB.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/프로그레스바/down1.png");
	_ColorBarB.x = 1088;
	_ColorBarB.y = 570;
	_ColorBarB.rc = RectMakeCenter(_ColorBarB.x, _ColorBarB.y, 256, 32);

	_ColorBarA.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/프로그레스바/down1.png");
	_ColorBarA.x = 1088;
	_ColorBarA.y = 600;
	_ColorBarA.rc = RectMakeCenter(_ColorBarA.x, _ColorBarA.y, 256, 32);

	_ColorBarControlR.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/ControlColor.png");
	_ColorBarControlR.x = 995;
	_ColorBarControlR.y = 512;
	_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);

	_ColorBarControlG.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/ControlColor.png");
	_ColorBarControlG.x = 995;
	_ColorBarControlG.y = 542;
	_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);

	_ColorBarControlB.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/ControlColor.png");
	_ColorBarControlB.x = 995;
	_ColorBarControlB.y = 572;
	_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);

	_ColorBarControlA.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/ControlColor.png");
	_ColorBarControlA.x = 995;
	_ColorBarControlA.y = 602;
	_ColorBarControlA.rc = RectMakeCenter(_ColorBarControlA.x, _ColorBarControlA.y, 32, 32);


	_Plus.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/확대.png");
	_Plus.x = 940;
	_Plus.y = 385;
	_Plus.rc = RectMakeCenter(_Plus.x, _Plus.y, 32, 32);

	_Minus.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/축소.png");
	_Minus.x = 940;
	_Minus.y = 420;
	_Minus.rc = RectMakeCenter(_Minus.x, _Minus.y, 32, 32);

	_Up.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/위.png");
	_Up.x = 1232;
	_Up.y = 385;
	_Up.rc = RectMakeCenter(_Up.x, _Up.y, 32, 32);

	_Down.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/아래.png");
	_Down.x = 1232;
	_Down.y = 420;
	_Down.rc = RectMakeCenter(_Down.x, _Down.y, 32, 32);

	_LookUp.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/위.png");
	_LookUp.x = 1088;
	_LookUp.y = 385;
	_LookUp.rc = RectMakeCenter(_LookUp.x, _LookUp.y, 32, 32);

	_LookDown.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/아래.png");
	_LookDown.x = 1088;
	_LookDown.y = 420;
	_LookDown.rc = RectMakeCenter(_LookDown.x, _LookDown.y, 32, 32);

	_Ok.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/결정.png");
	_Ok.x = 1088;
	_Ok.y = 700;
	_Ok.rc = RectMakeCenter(_Ok.x, _Ok.y, 64, 32);

	_LeftInfo.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/커스텀마이징2.png");
	_LeftInfo.x = 192;
	_LeftInfo.y = WINSIZEY / 2;

	_AtkAni1.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/찌른다.png");
	_AtkAni1.x = 192;
	_AtkAni1.y = 150;
	_AtkAni1.rc = RectMakeCenter(_AtkAni1.x, _AtkAni1.y, 64, 64);

	_AtkAni2.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/빙빙.png");
	_AtkAni2.x = 192;
	_AtkAni2.y = 300;
	_AtkAni2.rc = RectMakeCenter(_AtkAni2.x, _AtkAni2.y, 64, 64);

	_MoveAni.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/이동속도업.png");
	_MoveAni.x = 192;
	_MoveAni.y = 450;
	_MoveAni.rc = RectMakeCenter(_MoveAni.x, _MoveAni.y, 64, 64);

	_GuardAni.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/몰라.png");
	_GuardAni.x = 192;
	_GuardAni.y = 600;
	_GuardAni.rc = RectMakeCenter(_GuardAni.x, _GuardAni.y, 64, 64);
	
	_ColorBlue.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/파랑.png");
	_ColorBlue.x = 960;
	_ColorBlue.y = 650;
	_ColorBlue.rc = RectMakeCenter(_ColorBlue.x, _ColorBlue.y, 32, 32);

	_ColorBlack.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/검정.png");
	_ColorBlack.x = 1000;
	_ColorBlack.y = 650;
	_ColorBlack.rc = RectMakeCenter(_ColorBlack.x, _ColorBlack.y, 32, 32);

	_ColorYellow.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/노랑.png");
	_ColorYellow.x = 1040;
	_ColorYellow.y = 650;
	_ColorYellow.rc = RectMakeCenter(_ColorYellow.x, _ColorYellow.y, 32, 32);

	_ColorGreen.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/초록.png");
	_ColorGreen.x = 1080;
	_ColorGreen.y = 650;
	_ColorGreen.rc = RectMakeCenter(_ColorGreen.x, _ColorGreen.y, 32, 32);

	_ColorRed.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/빨강.png");
	_ColorRed.x = 1120;
	_ColorRed.y = 650;
	_ColorRed.rc = RectMakeCenter(_ColorRed.x, _ColorRed.y, 32, 32);

	_ColorSky.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/하늘.png");
	_ColorSky.x = 1160;
	_ColorSky.y = 650;
	_ColorSky.rc = RectMakeCenter(_ColorSky.x, _ColorSky.y, 32, 32);

	_ColorRand.Img = RESOURCE_TEXTURE->GetResource("../Resources/UI/랜덤.png");
	_ColorRand.x = 1200;
	_ColorRand.y = 650;
	_ColorRand.rc = RectMakeCenter(_ColorRand.x, _ColorRand.y, 32, 32);


	Ani = false;

	_HairColor = D3DXVECTOR4(0, 0, 0, 1);
	_R = _G = _B = _A = 0;
	R = G = B = A = false;

	return S_OK;
}
Exemple #29
0
void customize_Scene::MouseClick(void)
{

	if (PtInRect(&_HairLeft.rc, GetMousePos()))
	{
		if (HairNum > -1)
		{
			HairNum--;
			Push = true;
		}
		else
		{
			HairNum = _vHair.size() - 1;
			Push = true;
		}
	}
	else if (PtInRect(&_HairRight.rc, GetMousePos()))
	{
		if (HairNum < _vHair.size() - 1 || HairNum == -1)
		{
			HairNum++;
			Push = true;
		}
		else
		{
			HairNum = -1;
			Push = true;
		}
	}
	else if (PtInRect(&_HeadLeft.rc, GetMousePos()))
	{
		if (HeadNum > 0)
		{
			PrevNum2 = HeadNum;
			HeadNum--;
			Push2 = true;
		}
		else
		{
			PrevNum2 = HeadNum;
			HeadNum = _vHead.size() - 1;
			Push2 = true;
		}
	}
	else if (PtInRect(&_HeadRight.rc, GetMousePos()))
	{
		if (HeadNum < _vHead.size() - 1)
		{
			PrevNum2 = HeadNum;
			HeadNum++;
			Push2 = true;
		}
		else
		{
			PrevNum2 = HeadNum;
			HeadNum = 0;
			Push2 = true;
		}

	}
	else if (PtInRect(&_CameraFace.rc, GetMousePos()))
	{
		Z = 2;
		Y = 4.5;
		LookY = 4.3;
	}
	else if (PtInRect(&_CameraBody.rc, GetMousePos()))
	{
		Z = 6;
		Y = 4.5;
		LookY = 2;
	}
	else if (PtInRect(&_Plus.rc, GetMousePos()))
	{
		if (Z > 0.5)
		Z -= 0.2;
	}
	else if (PtInRect(&_Minus.rc, GetMousePos()))
	{
		if (Z < 10)
			Z += 0.2;
	}
	else if (PtInRect(&_Up.rc, GetMousePos()))
	{
		Y += 0.2;
	}
	else if (PtInRect(&_Down.rc, GetMousePos()))
	{
		Y -= 0.2;
	}
	else if (PtInRect(&_LookUp.rc, GetMousePos()))
	{
		LookY += 0.2;
	}
	else if (PtInRect(&_LookDown.rc, GetMousePos()))
	{
		LookY -= 0.2;
	}
	else if (PtInRect(&_AtkAni1.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Combo1_Double");
			Ani = true;
		}
	}
	else if (PtInRect(&_AtkAni2.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Combo2_Double");
			Ani = true;
		}
	}
	else if (PtInRect(&_GuardAni.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Idle3");
			Ani = true;
		}
	}
	else if (PtInRect(&_MoveAni.rc, GetMousePos()))
	{
		if (!Ani)
		{
			PlayOneShot("Run");
			Ani = true;
		}		
	}
	else if (PtInRect(&_Ok.rc, GetMousePos()))
	{
		if (HairNum == -1)
		{
			SCENEMANAGER->FindScece("game")->TempHair = "없음";
		}
		else
		{
			SCENEMANAGER->FindScece("game")->TempHair = _vHair[HairNum]->filePath;
		}
		SCENEMANAGER->FindScece("game")->TempHead = _vHead[HeadNum]->filePath;
		SCENEMANAGER->FindScece("game")->TempColor = _HairColor;
		
		for (int i = 0; i < _vHead.size(); i++)
		{
			if (i == HeadNum)continue;
			RESOURCE_SKINNEDXMESH->RemoveResource(_vHead[i]->filePath);
		}
		if (HairNum == -1)
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		else
		{
			for (int i = 0; i < _vHair.size(); i++)
			{
				if (i == HairNum)continue;
				RESOURCE_SKINNEDXMESH->RemoveResource(_vHair[i]->filePath);
			}
		}
		//RESOURCE_TEXTURE->ClearResource();
		SCENEMANAGER->ChangeScene("game");
	} 
	else if (PtInRect(&_ColorBarControlR.rc, GetMousePos()))
	{
		R = true; WINSIZEX; WINSIZEY;
	}
	else if (PtInRect(&_ColorBarControlG.rc, GetMousePos()))
	{
		G = true;
	}
	else if (PtInRect(&_ColorBarControlB.rc, GetMousePos()))
	{
		B = true;
	}
	else if (PtInRect(&_ColorBarControlA.rc, GetMousePos()))
	{
		A = true;
	}
	else if (PtInRect(&_ColorBlue.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 1180;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorBlack.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorGreen.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorRed.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 1180;
		_ColorBarControlG.x = 995;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorSky.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 995;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 1180;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorYellow.rc, GetMousePos()))
	{
		_ColorBarControlR.x = 1180;
		_ColorBarControlG.x = 1180;
		_ColorBarControlB.x = 995;
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	else if (PtInRect(&_ColorRand.rc, GetMousePos()))
	{
		_ColorBarControlR.x = RandomFloatRange(995,1180);
		_ColorBarControlG.x = RandomFloatRange(995,1180);
		_ColorBarControlB.x = RandomFloatRange(995,1180);
		_ColorBarControlR.rc = RectMakeCenter(_ColorBarControlR.x, _ColorBarControlR.y, 32, 32);
		_ColorBarControlG.rc = RectMakeCenter(_ColorBarControlG.x, _ColorBarControlG.y, 32, 32);
		_ColorBarControlB.rc = RectMakeCenter(_ColorBarControlB.x, _ColorBarControlB.y, 32, 32);
		_R = _ColorBarControlR.x - 995;
		_G = _ColorBarControlG.x - 995;
		_B = _ColorBarControlB.x - 995;
	}
	//pMainCamera->GetWorldPosToScreenPos()
}