Ejemplo n.º 1
0
void PropertyTimelineView::mouseMoveEvent(QMouseEvent* event) {
    if(currentFrameChange_) {
        if(mapToScene(event->pos()).x() < 0)
            emit frameChange(0);
        else if(mapToScene(event->pos()).x() > (int)AnimationEditor::getDuration())
            emit frameChange(static_cast<int>(AnimationEditor::getDuration()));
        else
            emit frameChange(static_cast<int>(mapToScene(event->pos()).x()));
    }
    QGraphicsView::mouseMoveEvent(event);
}
Ejemplo n.º 2
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);
}