示例#1
0
void Game_Character::Update() {
	if (IsJumping()) {
		UpdateJump();
		anime_count += (IsSpinning() ? 1.0 : 0);
	} else if (IsContinuous() || IsSpinning()) {
		UpdateMove();
		UpdateStop();
	} else {
		if (IsMoving()) {
			UpdateMove();
		} else {
			UpdateStop();
		}
	}

	if (anime_count > 36.0/(GetMoveSpeed()+1)) {
		if (IsSpinning()) {
			SetPrelockDirection((GetPrelockDirection() + 1) % 4);
		} else if (!IsContinuous() && IsStopping()) {
			pattern = original_pattern;
			last_pattern = last_pattern == RPG::EventPage::Frame_left ? RPG::EventPage::Frame_right : RPG::EventPage::Frame_left;
		} else {
			if (last_pattern == RPG::EventPage::Frame_left) {
				if (pattern == RPG::EventPage::Frame_right) {
					pattern = RPG::EventPage::Frame_middle;
					last_pattern = RPG::EventPage::Frame_right;
				} else {
					pattern = RPG::EventPage::Frame_right;
				}
			} else {
				if (pattern == RPG::EventPage::Frame_left) {
					pattern = RPG::EventPage::Frame_middle;
					last_pattern = RPG::EventPage::Frame_left;
				} else {
					pattern = RPG::EventPage::Frame_left;
				}
			}
		}

		anime_count = 0;
	}

	if (wait_count > 0) {
		wait_count -= 1;
		return;
	}

	if (stop_count >= ((GetMoveFrequency() > 7) ? 0 : pow(2.0, 9 - GetMoveFrequency()))) {
		if (IsMoveRouteOverwritten()) {
			MoveTypeCustom();
		} else if (Game_Message::GetContinueEvents() || !Game_Message::message_waiting) {
			UpdateSelfMovement();
		}
	}
}
示例#2
0
extern void
ShowMove(hintdata * phd, const int f)
{
    char *sz;
    TanBoard anBoard;
    if (f) {
        move *pm;
        GList *plSelList = MoveListGetSelectionList(phd);
        if (!plSelList)
            return;

        /* the button is toggled */
        pm = MoveListGetMove(phd, plSelList);

        MoveListFreeSelectionList(plSelList);

        memcpy(anBoard, msBoard(), sizeof(TanBoard));
        ApplyMove(anBoard, pm->anMove, FALSE);

        UpdateMove((BOARD(pwBoard))->board_data, anBoard);
    } else {

        sz = g_strdup("show board");
        UserCommand(sz);
        g_free(sz);

    }
#if USE_BOARD3D
    RestrictiveRedraw();
#endif
}
示例#3
0
/***********************************************************
set rotation
***********************************************************/
void ExternalPlayer::SetRotation(float angle)
{
	PlayerMoveInfo minfo;
    minfo.CurrentPos.X = _dr._posX;
    minfo.CurrentPos.Y = _dr._posY;
    minfo.CurrentPos.Z = _dr._posZ;
	minfo.CurrentPos.Rotation = angle;
    minfo.CurrentSpeedX = _dr._velocityX;
    minfo.CurrentSpeedY = _dr._velocityY;
    minfo.CurrentSpeedZ = _dr._velocityZ;
    minfo.CurrentSpeedRotation = 0;
	UpdateMove(SynchronizedTimeHandler::GetCurrentTimeDouble(), minfo, false);
}
示例#4
0
void MoveMonitor::Update(float dt)
{
	if ( IsStepOver() )
	{
		return ;
	}

	if ( m_nType == MoveType_Normal )
	{
		UpdateMove(dt);
	}
	else if( m_nType == MoveType_Flash )
	{
		UpdateFlash(dt); 
	}
}
示例#5
0
void Game_Character::Update() {
	/*if (IsJumping())
		UpdateJump();
	else*/ if (IsMoving())
		UpdateMove();
	else
		UpdateStop();

	if (anime_count > 18 - move_speed * 2) {
		if (!step_anime && stop_count > 0) {
			pattern = original_pattern;
			last_pattern = last_pattern == RPG::EventPage::Frame_left ? RPG::EventPage::Frame_right : RPG::EventPage::Frame_left;
		} else {
			if (last_pattern == RPG::EventPage::Frame_left) {
				if (pattern == RPG::EventPage::Frame_right) {
					pattern = RPG::EventPage::Frame_middle;
					last_pattern = RPG::EventPage::Frame_right;
				} else {
					pattern = RPG::EventPage::Frame_right;
				}
			} else {
				if (pattern == RPG::EventPage::Frame_left) {
					pattern = RPG::EventPage::Frame_middle;
					last_pattern = RPG::EventPage::Frame_left;
				} else {
					pattern = RPG::EventPage::Frame_left;
				}
			}
		}

		anime_count = 0;
	}

	/*if (wait_count > 0) {
		wait_count -= 1
		return;
	}*/

	if (move_route_forcing) {
		MoveTypeCustom();
	} else if (!locked) {
		UpdateSelfMovement();
	}
}
	void FringeTileEditor::Update()
	{
		if (isOn)
		{
			UpdateCamera();

			if (state == FTES_NONE)
			{
				UpdateSelect();
			}

			if (selectedEntity)
			{
				switch (state)
				{
				case FTES_NONE:
					UpdateOpportunity();
					break;

				case FTES_COMMAND:
					UpdateCommand();
					break;

				case FTES_MOVE:
					UpdateMove();
					break;

				case FTES_ROTATE:
					UpdateRotate();
					break;

				case FTES_SCALE:
					UpdateScale();
					break;
				}
			}
		}
	}
示例#7
0
void GamePlayer::PadEventLeft()
{
	math::Vector2 moveVal = math::Vector2(-1.0f*m_speedMove, 0.0f);
	UpdateMove( moveVal );
}
示例#8
0
void GamePlayer::PadEventDown()
{
	math::Vector2 moveVal = math::Vector2(0.0f, 1.0f*m_speedMove);
	UpdateMove( moveVal );
}
示例#9
0
/* ================================================ */
void GamePlayer::Update()
{
	if( m_playerLife == 0 ){
		return;
	}

	{
		// 毎フレーム値が変わるような項目はここで

		// ダッシュ関連
		m_speedMove = m_speedMoveBase * static_cast<uint32_t>(m_speedMultiply + 0.5f);
		if( m_speedMultiply > 1.0f ){
			m_speedMultiply *= 0.94f;
			
			// 3フレームに一回残像エフェクト描画
			if( FpsManager::GetUpdateCounter() % 3 == 0 && m_speedLv >= 3 ){
				GameEffect::CreateEffect( GameEffect::EFFECT_DASH_SMOKE, Utility::GetPlayerPos() );
			}
		}
		// 一定数になったら切り捨て(終了)
		if( m_speedMultiply < 1.2f || m_speedLv == Common::STATUS_LEVEL_MAX ){
			m_speedMultiply = 1.0f;
		}
		// 早すぎる場合は切り捨て
		if( m_speedMove > DASH_SPEED_MAX ){
			m_speedMove = DASH_SPEED_MAX;
		}

		// 毒状態ならデクリメント
		if( m_poisonTime > 0 ){
			--m_poisonTime;
			if( FpsManager::GetUpdateCounter() % 40 == 0 ){
				// 一定時間ごとにダメージ
				ReflectDamage( 3 );
			}
			if( m_poisonTime == 0 ){
				// 毒状態終了
				SetPlayerState( ABNORMAL_STATE_POISON, false );
			}
		}
		// 毒にならない時間帯(毒から回復した直後)ならインクリメント
		else if( m_poisonTime < 0 ){
			++m_poisonTime;
		}

		// 無敵時間中ならデクリメント
		if( m_invisibleTime > 0 ){
			--m_invisibleTime;
		}

		// 操作不能時間中ならデクリメント
		if( m_invalidCtrlTime > 0 ){
			--m_invalidCtrlTime;
			if( m_invalidCtrlTime == 0 ){
				// 操作不能時間終了
				SetPlayerState( ABNORMAL_STATE_MOVE_LOCK, false );
			}
		}

		// 炎ダメージアイコン
		if( m_fireTime >= 0 ){
			--m_fireTime;
			if( m_fireTime == 0 ){
				SetPlayerState( ABNORMAL_STATE_FIRE, false );
			}
		}
	}

	// 現在のライフセット
	if( m_pStatusMenu ){
		m_pStatusMenu->SetPlayerHP( m_playerLife, m_playerLifeMax );
	}

	// 操作不能中でないならパッドイベントをコール
	if( m_invalidCtrlTime == 0 ){
		// パッドに対応した挙動を設定
		CallPadEvent();
		
		// 攻撃判定
		if( GetStickInfoRight().m_vec != DEFAULT_VECTOR2 ){
			const TEX_DRAW_INFO &drawInfo = m_drawTexture.m_pTex2D->GetDrawInfo();
			math::Vector2 pos = math::Vector2( drawInfo.m_posOrigin.x, drawInfo.m_posOrigin.y ) + GameAccesser::GetInstance()->GetPlayerOffSet();
			math::Vector2 vec = GetStickInfoRight().m_vec;
			vec.Normalize();
			m_attackGun->ShootBullet( pos, vec );
		}
	}

	// 外からのダメージ等での強制移動
	if( m_forceMoveInfo.m_posX != 0.0f 
		&& m_forceMoveInfo.m_posY != 0.0f ){
		if( m_forceMoveInfo.m_forcePower <= 1.0f ){
			m_forceMoveInfo.Init();
		}
		else{
			math::Vector2 forceVec = math::Vector2( m_forceMoveInfo.m_posX, m_forceMoveInfo.m_posY );
			UpdateMove( forceVec*m_forceMoveInfo.m_forcePower, /*bool isForce=*/true );
			m_forceMoveInfo.m_forcePower *= 0.9f;
		}
	}

	// 再生アニメタグセット
	m_drawTexture.m_pTex2D->SetAnim(GetAnimTag());
}
示例#10
0
//**関数***************************************************************************
//	概要	:	更新
//*********************************************************************************
void CObjButton::Update()
{
	UpdateMove();				// 挙動更新
 	UpdateState();				// 状態更新
}