Exemplo n.º 1
0
//=============================================================================
// 更新処理
//=============================================================================
void UpdateTimeCounter(void)
{
	if(*GetIsPlay() == true && !*GetIsPause())
	{
		g_nFrameCounter++;
		if(g_nFrameCounter % 6 == 0)
		{
			g_nTimeCounter.fCurrentTime += 0.1f;
			g_nTimeCounter.fPlaybarTime += 0.1f;
		}
	}
	else if(*GetIsStop() == true)
	{
		g_nTimeCounter.fCurrentTime = 0;
		g_nTimeCounter.fPlaybarTime = 0;
	}
	
	// 添加时间轴判断进行时间复位
	if(g_nTimeCounter.fCurrentTime >= *PlaybarNum() * TIME_5)
	{
		g_nTimeCounter.fCurrentTime = 0;
		//g_nTimeCounter.fPlaybarTime = 0;
		bIsTimeReCount = true;
	}

	// ゲームモードだけ表示する
	if(*GetGameMode() == SELECTMODE_PLAY)
	{
		PrintDebugProc("SystemTime : %f\n", g_nTimeCounter.fCurrentTime);
		PrintDebugProc("PlaybarTime : %f\n", g_nTimeCounter.fPlaybarTime);
	}
}
Exemplo n.º 2
0
// プレーヤー編集
void PlayerEdit(void)
{
	PrintDebugProc("\n\n");
	PrintDebugProc("**************************************************\n");
	PrintDebugProc("【メニュー】 【属性】    【数値】\n");
	PrintDebugProc("   【1】   【すばやさX】  : %f\n", g_aPlayer[0].fSpeedX);
	PrintDebugProc("**************************************************\n");
	PrintDebugProc("\n\n");

	PrintDebugProc("矢印キー【左】、【右】   【+- 0.1】\n");
	PrintDebugProc("矢印キー【上】、【下】   【+- 0.5】\n");
	PrintDebugProc("   【1】   【開始時間】  : %f\n\n");
	if(GetKeyboardRepeat(DIK_LEFT))
		g_aPlayer[0].fSpeedX -= 0.1f;
	if(GetKeyboardRepeat(DIK_RIGHT))
		g_aPlayer[0].fSpeedX += 0.1f;
	if(GetKeyboardRepeat(DIK_DOWN))
		g_aPlayer[0].fSpeedX -= 0.5f;
	if(GetKeyboardRepeat(DIK_UP))
		g_aPlayer[0].fSpeedX += 0.5f;
}
Exemplo n.º 3
0
//=============================================================================
// 更新処理
//=============================================================================
void UpdateGameManager(void)
{
#ifdef _DEBUG
	if(GetKeyboardTrigger(DIK_F1))
	{
		g_nGameMode = SELECTMODE_PLAY;
	}
	if(GetKeyboardTrigger(DIK_F2))
	{
		g_nGameMode = SELECTMODE_WALLEDIT;
	}
	if(GetKeyboardTrigger(DIK_F3))
	{
		g_nGameMode = SELECTMODE_GIMMICKEDIT;
	}
	if(GetKeyboardTrigger(DIK_F4))
	{
		g_nGameMode = SELECTMODE_PLAYEREDIT;
	}
	if(GetKeyboardTrigger(DIK_F5))
	{
		g_nGameMode = SELECTMODE_DELETE;
	}
	if(GetKeyboardTrigger(DIK_F6))
	{
		g_nGameMode = SELECTMODE_SCENECHANGE;
	}
	if(GetKeyboardTrigger(DIK_F7))
	{
		g_nGameMode = SELECTMODE_PLAYERBAR_NUM;
	}
	if(GetKeyboardTrigger(DIK_F8))
	{
		g_nGameMode = SELECTMODE_ITEMNUMEDIT;
	}
	if(g_nGameMode != SELECTMODE_PLAY)
		GetBackG()[BACKGROUND_EDIT_NET].bUse = true;
	else
		GetBackG()[BACKGROUND_EDIT_NET].bUse = false;

#endif

	switch (g_nGameMode)
	{
	case SELECTMODE_PLAY:
	{
		PrintDebugProc("【ゲームモード】\n");
		if(GetTimeCounter()->fCurrentTime > TIME_15)
			g_bIsPlay = false;

		if(!g_bIsPlay)
		{
			if(IsMouseRightTriggered())
			{
				int nGimNum = -1;
				int nItemNum = GetItemNum()->nItemLockTime;
				bool bIsLock = false;

				if(IsGimmickLock(&nGimNum, &bIsLock, &nItemNum) == true)
				{
					if(bIsLock == true)
					{
						SetItem(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), ITEM_TYPE_01, nGimNum);
						UpdataItemNum(-1);
					}
					else
					{
						DeleteItem(nGimNum);
						UpdataItemNum(1);
					}
				}
			}
		}
		break;
	}
	case SELECTMODE_WALLEDIT:
	{
		PrintDebugProc("【壁を編集するモード】\n");
		WallCreateMode();
		break;
	}
	case SELECTMODE_GIMMICKEDIT:
	{
		PrintDebugProc("【ギミック編集モード】\n");
		GimmickCreateMode();
		break;
	}
	case SELECTMODE_PLAYEREDIT:
	{
		PrintDebugProc("【プレイヤー編集モード】\n");
		if(IsMouseLeftPressed())
			IsMouseHitPlayer();
		PlayerEdit();
		break;
	}
	case SELECTMODE_DELETE:
	{
		PrintDebugProc("【削除モード】\n");
		DeleteGimmick();
		DeleteWall();
		break;
	}
	case SELECTMODE_SCENECHANGE:
	{
		PrintDebugProc("【ステージ切り替えるモード】\n");
		if(IsMouseRightTriggered())
		{
			if(*GetSceneNum() < SCENE_TYPE_MAX)
				(*GetSceneNum())++;
			if(*GetSceneNum() == SCENE_TYPE_MAX)
				*GetSceneNum() = 0;
			g_bIsSceneInit = true;
		}

		if(g_bIsSceneInit == true)
		{
			g_bIsSceneInit = false;
			switch (*GetSceneNum())
			{
			case SCENE_01:
				// 从文件中读取
				LoadData(SCENE_01);
				break;
			case SCENE_02:
				// 从文件中读取
				LoadData(SCENE_02);
				break;
			case SCENE_03:
				// 从文件中读取
				LoadData(SCENE_03);
				break;
			case SCENE_04:
				// 从文件中读取
				LoadData(SCENE_04);
				break;
			case SCENE_05:
				// 从文件中读取
				LoadData(SCENE_05);
				break;
			default:
				break;
			}
			// 読み込むデータを初期化
			InitDataPlayer();
			InitDataWall();
			InitDataGimmick();
			InitDataPlayerbar();

			for(int nCntGim = 0; nCntGim < MAX_GIMMICK; nCntGim++)
			{
				// 根据补完的数据对机关场景进行位置和运动预处理
				SetupGimmickTrack(nCntGim);
				*GetCleanupSwitch() = false;
			}
		}
		break;
	}
	case SELECTMODE_PLAYERBAR_NUM:
	{
		PrintDebugProc("【時間軸編集モード】\n");
		PrintDebugProc("数字キー「1」 時間軸数:1\n");
		PrintDebugProc("数字キー「2」 時間軸数:2\n");
		PrintDebugProc("数字キー「3」 時間軸数:3\n");
		if(GetKeyboardTrigger(DIK_1))
		{
			for(int nCntPlayBar = 0; nCntPlayBar < MAX_PLAYBAR; nCntPlayBar++)
			{
				//if(g_pPlaybar_GM[nCntPlayBar].bUse == true)
					g_pPlaybar_GM[nCntPlayBar].bUse = false;
			}
			for(int nCntGim = 0; nCntGim < MAX_GIMMICK; nCntGim++)
			{
				if(g_pGimmick_GM[nCntGim].bUse)
				{
					g_pGimmick_GM[nCntGim].nPriorityNum01 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum02 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum03 = -1;
				}
			}
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_1);
			PlaybarNumCount();
		}
		if(GetKeyboardTrigger(DIK_2))
		{
			for(int nCntPlayBar = 0; nCntPlayBar < MAX_PLAYBAR; nCntPlayBar++)
			{
				//if(g_pPlaybar_GM[nCntPlayBar].bUse == true)
					g_pPlaybar_GM[nCntPlayBar].bUse = false;
			}
			for(int nCntGim = 0; nCntGim < MAX_GIMMICK; nCntGim++)
			{
				if(g_pGimmick_GM[nCntGim].bUse)
				{
					g_pGimmick_GM[nCntGim].nPriorityNum01 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum02 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum03 = -1;
				}
			}
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_1);
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_2);
			PlaybarNumCount();
		}
		if(GetKeyboardTrigger(DIK_3))
		{
			for(int nCntPlayBar = 0; nCntPlayBar < MAX_PLAYBAR; nCntPlayBar++)
			{
				//if(g_pPlaybar_GM[nCntPlayBar].bUse == true)
					g_pPlaybar_GM[nCntPlayBar].bUse = false;
			}
			for(int nCntGim = 0; nCntGim < MAX_GIMMICK; nCntGim++)
			{
				if(g_pGimmick_GM[nCntGim].bUse)
				{
					g_pGimmick_GM[nCntGim].nPriorityNum01 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum02 = -1;
					g_pGimmick_GM[nCntGim].nPriorityNum03 = -1;
				}
			}
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_1);
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_2);
			SetPlaybar(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f), PLAYBAR_3_3);
			PlaybarNumCount();
		}
		break;
	}
	case SELECTMODE_ITEMNUMEDIT:
	{
		PrintDebugProc("【アイテム個数編集モード】\n");
		PrintDebugProc("【メニュー】    【アイテム】    【個数】\n");
		PrintDebugProc("数字キー「1」 時間固定アイテム:%d\n\n", g_pItemNum_GM->nItemLockTime);

		if(GetKeyboardTrigger(DIK_1))
		{
			g_nMenuSelect_GM = 1;
		}

		switch (g_nMenuSelect_GM)
		{

			case 1:
				PrintDebugProc("矢印キー【左】、【右】   【プラス/マイナス 1】\n");
				PrintDebugProc("矢印キー【上】、【下】   【プラス/マイナス 5】\n");

				if(GetKeyboardRepeat(DIK_LEFT))
				{
					g_pItemNum_GM->nItemLockTime -= 1;
					if(g_pItemNum_GM->nItemLockTime < 0)
						g_pItemNum_GM->nItemLockTime = 0;
				}
				if(GetKeyboardRepeat(DIK_RIGHT))
				{
					g_pItemNum_GM->nItemLockTime += 1;
					if(g_pItemNum_GM->nItemLockTime > 9)
						g_pItemNum_GM->nItemLockTime = 9;
				}
				if(GetKeyboardRepeat(DIK_DOWN))
				{
					g_pItemNum_GM->nItemLockTime -= 5;
					if(g_pItemNum_GM->nItemLockTime < 0)
						g_pItemNum_GM->nItemLockTime = 0;
				}
				if(GetKeyboardRepeat(DIK_UP))
				{
					g_pItemNum_GM->nItemLockTime += 5;
					if(g_pItemNum_GM->nItemLockTime > 9)
						g_pItemNum_GM->nItemLockTime = 9;
				}
				break;
			default:
				break;
		}

	}
	default:
		break;
	}

	if(!g_bIsPlay)
	{
		switch (*GetSceneNum())
		{
		case SCENE_01:
			PrintDebugProc("【SCENE_01】\n");
			// 今のシーンをセーフする
			if(IsMouseCenterTriggered())
				SaveData(SCENE_01);
			break;

		case SCENE_02:
			PrintDebugProc("【SCENE_02】\n");
			if(IsMouseCenterTriggered())
				SaveData(SCENE_02);
			break;

		case SCENE_03:
			PrintDebugProc("【SCENE_03】\n");
			if(IsMouseCenterTriggered())
				SaveData(SCENE_03);
			break;

		case SCENE_04:
			PrintDebugProc("【SCENE_04】\n");
			if(IsMouseCenterTriggered())
				SaveData(SCENE_04);
			break;

		case SCENE_05:
			PrintDebugProc("【SCENE_05】\n");
			if(IsMouseCenterTriggered())
				SaveData(SCENE_05);
			break;

		default:
			break;
		}
	}

	switch(*GetMode())
	{
	case GAMEMODE_LOGO:
		break;

	case GAMEMODE_TITLE:
	{
		if(GetKeyboardTrigger(DIK_RETURN) || IsMouseLeftTriggered())
			SetFade(FADE_OUT, FADE_IN, GAMEMODE_STAGE_SELECT);
		break;
	}
	case GAMEMODE_STAGE_SELECT:
	{
		g_bIsStop = true;
		g_bIsPlay = false;

		if(GetKeyboardTrigger(DIK_RETURN))
			SetFade(FADE_OUT, FADE_IN, GAMEMODE_GAME);

		if(IsMouseLeftTriggered())
		{
			int pIconNum = 0;
			if(IsMouseHitIcon(&pIconNum) == true)
			{
				*GetSceneNum() = GetGameElement()[pIconNum].nType;
				g_bIsSceneInit = true;
			}
		}

		if(g_bIsSceneInit == true)
		{
			g_bIsSceneInit = false;
			switch (*GetSceneNum())
			{
			case SCENE_01:
				// 从文件中读取
				LoadData(SCENE_01);
				break;
			case SCENE_02:
				// 从文件中读取
				LoadData(SCENE_02);
				break;
			case SCENE_03:
				// 从文件中读取
				LoadData(SCENE_03);
				break;
			case SCENE_04:
				// 从文件中读取
				LoadData(SCENE_04);
				break;
			case SCENE_05:
				// 从文件中读取
				LoadData(SCENE_05);
				break;
			default:
				break;
			}
			// 読み込むデータを初期化
			InitDataPlayer();
			InitDataWall();
			InitDataGimmick();
			InitDataPlayerbar();

			for(int nCntGim = 0; nCntGim < MAX_GIMMICK; nCntGim++)
			{
				// 根据补完的数据对机关场景进行位置和运动预处理
				SetupGimmickTrack(nCntGim);
				*GetCleanupSwitch() = false;
			}
			//*GetMode() = GAMEMODE_GAME;

			SetFade(FADE_OUT, FADE_IN, GAMEMODE_GAME);
		}
		
		break;
	}
	case GAMEMODE_GAME:
		break;

	case GAMEMODE_END:
		break;

	default:
		break;
	}



}