Ejemplo n.º 1
0
void dying::update(){
	diedtime++;

	//死んだ瞬間の処理
	if(diedtime == 1){startdying();}

	//一定時間経過でリザルトへ移行
	if(diedtime > 360){
		ptr->meffect->make(0, 0, 10, 0, 0);
		gamestate = 30;
	}

	//血を出す
	if((keika % 3)== 0){
		ptr->meffect->make((int)ptr->mplayer->x, (int)ptr->mplayer->y, 4, -1, -1);
		SetDrawScreen( zanzou ) ;
		SetDrawBlendMode( DX_BLENDMODE_ALPHA , 200 ) ;
		DrawRotaGraph((int)ptr->mplayer->x, (int)ptr->mplayer->y, randarc()*1.0+0.7, PI*randarc(), GHandle[7], 1);
		SetDrawBlendMode( DX_BLENDMODE_ALPHA , 255 ) ;
		SetDrawScreen( DX_SCREEN_BACK ) ;
	}


	ptr->menemy->update();
	ptr->meffect->update();
	ptr->mstr_log->update();
}
Ejemplo n.º 2
0
void emy_bomb::Isdead(){
	if (hp < 0.1){

		Sound::playback("bomb01");
		for (int j = 0; j < 6; j++){
			manager::get().effect_.add<dotsplash>(x, y);
			auto efp = manager::get().effect_.add<enemybombef>(x, y);
			double dx, dy;
			Func::polartoxy(dx, dy, Random::FRand(7.0, 15.0), 2 * PI * j / 6 + Random::FRand(0.0, 0.5));
			efp->vx = dx;
			efp->vy = dy;
		}
		manager::get().damagearea_.addptr(std::make_shared<dm_circle>(x, y, 100, 10, 0.0));

		SetDrawScreen(Screen::get().blood);
		for (int i = 0; i < 5; i++){
			double dx, dy;
			Random::RandInCircle(32, dx, dy);
			Draw_::exrot(x + dx, y + dy, Random::FRand(0.5, 1.5), Random::FRadRand(), Graph::handle("blood01"), 255);
		}
		SetDrawScreen(DX_SCREEN_BACK);
		deadlog();
		addscore();
		deleteflag = true;
	}
}
Ejemplo n.º 3
0
void Window::DrawStringInWindow(int Input_x,int Input_y,int Input_Pos,string Input_String,int FontData,int Color)
{
	vector<string> Strs = split(Input_String,"<>");
	int Height;
	GetFontStateToHandle(NULL,&Height,NULL,FontData);
	Height *= 1.4;
	int Length = Strs.size();
	int Draw_y = Input_y-Height;
	for(int i=0;i<Length;i++)
	{
		int Graph;
		int Draw_x = Input_x;
		Draw_y += Height;
		int DrawWidth = GetDrawStringWidthToHandle(Strs[i].c_str(),Strs[i].size(),FontData);
		int Size;
		float Ext = 1.0f;
		if(Input_Pos == DrawString_Center)Draw_x -= DrawWidth/2;
		else if(Input_Pos == DrawString_Right)Draw_x -= DrawWidth;
		GetFontStateToHandle(0,&Size,0,FontData);
		Graph = MakeScreen(DrawWidth,Size*2,true);
		SetDrawScreen(Graph);
		DrawStringToHandle(0,0,Strs[i].c_str(),Color,FontData);

		if(DrawWidth + Draw_x >= Width)
		{
			Ext = (float)Width / (float)(DrawWidth  + Draw_x) - 0.01f;
		}

		SetDrawScreen(Screen);
		DrawRotaGraph2(Draw_x,Draw_y,0,0,Ext,0.f,Graph,true);
		DeleteGraph(Graph);
	}
	SetDrawScreen(DX_SCREEN_BACK);
}
Ejemplo n.º 4
0
void Window::ReWindow()
{
	//SetDrawScreen(DX_SCREEN_BACK);
	SetDrawScreen(Screen);
	DrawBox(0,0,Width,Height,GetColor(255,255,255),true);
	SetDrawBlendMode( DX_BLENDMODE_ALPHA, 128);
	DrawBox(0,0,Width,Height,PanelColor,true);
	SetDrawBlendMode( DX_BLENDMODE_ALPHA, 256);
	DrawBox(0,0,Width,Height,EdgeColor,false);
	SetDrawScreen(DX_SCREEN_BACK);
}
Ejemplo n.º 5
0
void p9(void) {
	SetDrawScreen(DX_SCREEN_BACK);

	char keybuf[256];

	while (ProcessMessage() == 0 && GetHitKeyStateAll(keybuf) == 0 && keybuf[KEY_INPUT_ESCAPE] == 0) {
		ClearDrawScreen();
		DrawLine(10, 10, 200, 10, GetColor(255, 0, 0));
		DrawLine(10, 20, 200, 20, GetColor(0, 255, 0));
		DrawLine(10, 30, 200, 30, GetColor(0, 0, 255));
		SetDrawBlendMode(DX_BLENDMODE_ALPHA, 100);	//	αブレンド
		DrawBox(5, 5, 205, 35, GetColor(255, 255, 255), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_NOBLEND, TRUE);	//	ブレンドなし
		DrawBox(100, 100, 201, 201, GetColor(255, 0, 0), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_ADD, 255);	//	加算ブレンド
		DrawCircle(150, 150, 50, GetColor(0, 255, 255), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_SUB, 255);	//	減算ブレンド
		DrawCircle(150, 150, 30, GetColor(0, 100, 100), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_INVSRC, 255);	//	反転ブレンド
		DrawOval(300, 200, 30, 25, GetColor(0, 0, 0), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_MULA, 255);	//	乗算ブレンド
		DrawOval(300, 200, 25, 30, GetColor(0, 100, 100), TRUE);
		SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
		DrawPixel(320, 240, GetColor(255, 255, 255));
		DrawTriangle(5, 5, 205, 5, 5, 35, GetColor(0, 0, 0), TRUE);
		DrawTriangle(5, 5, 205, 5, 5, 35, GetColor(255, 255, 255), FALSE);

		ScreenFlip();
	}
}
Ejemplo n.º 6
0
void p12(void) {
	SetDrawScreen(DX_SCREEN_BACK);

	int i;
	char keybuf[256];
	int img;

	i = 0;
	img = LoadGraph("pic11.png");

	while (ProcessMessage() == 0 && GetHitKeyStateAll(keybuf) == 0 && keybuf[KEY_INPUT_ESCAPE] == 0) {
		ClearDrawScreen();

		DrawRotaGraph(120, 239, 1.0, PI / 4.0, img, TRUE);
		DrawCircle(120, 239, 5, GetColor(255, 0, 0), TRUE);

		DrawRotaGraph(320, 239, 1.0, PI / 180.0 * i, img, TRUE);
		DrawCircle(320, 239, 5, GetColor(255, 0, 0), TRUE);

		DrawRotaGraph2(520, 239, 19, 19, 1.0, PI / 180.0 * i * 2, img, TRUE);
		DrawCircle(520, 239, 5, GetColor(255, 0, 0), TRUE);
		ScreenFlip();

		i++;
	}


}
Ejemplo n.º 7
0
static void begin_depthmap_pass(Shader *self)
{
	// 描画先を影用深度記録画像にする
	SetDrawScreen(self->depthmap_screen);

	// 影用深度記録画像を真っ白にクリア
	SetBackgroundColor(255, 255, 255);
	ClearDrawScreen();
	SetBackgroundColor(0, 0, 0);

	// カメラのタイプを正射影タイプにセット、描画範囲も指定
	SetupCamera_Ortho(13250.0f);

	// 描画する奥行き範囲をセット
	SetCameraNearFar(10.0f, 13050.0f);

	// カメラの位置と注視点はステージ全体が見渡せる位置
	VECTOR LightTarget = VGet(3620.0f, 0.0f, 3830.0f);

	// カメラの向きはライトの向き
	VECTOR LightDirection = VScale(GetLightDirection(), -12400.0f);

	// カメラの位置と注視点はステージ全体が見渡せる位置
	VECTOR LightPosition = VAdd(LightTarget, LightDirection);

	SetCameraPositionAndTarget_UpVecY(LightPosition, LightTarget);

	self->light_camera_view_matrix = GetCameraViewMatrix();
	self->light_camera_projection_matrix = GetCameraProjectionMatrix();

	SetUseVertexShader(self->depthmap_vs);
	SetUsePixelShader(self->depthmap_ps);
}
Ejemplo n.º 8
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    system_init();
    if (DxLib_Init() == -1 || SetDrawScreen(DX_SCREEN_BACK) != 0)return -1; // 初期化と裏画面化

    game_init();


    LogSP log1 = LogSP(new Log("あいうえお"));
    LogSP log2 = LogSP(new Log("かきくけこ"));
    LogSP log3 = LogSP(new Log("さしすせそ"));
    manager.push(log1);
    manager.push(log2);
    manager.push(log3);


    while (ProcessLoop())
    {
        mso::KeyBoard::SetNowState();

        manager.process();

        mso::FpsController::Wait();
        mso::FpsController::Draw();

        ScreenFlip(); // 裏画面反映

        mso::KeyBoard::KeepPrevState();
    }


    DxLib_End();
    return 0;
}
Ejemplo n.º 9
0
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); //ウィンドウモード変更と初期化と裏画面設定
	SetGraphMode(512,512,16) ;//ディスプレイの大きさの設定

	SceneMgr sceneMgr;
    sceneMgr.Initialize();


	while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && gpUpdateKey()==0 ){
        sceneMgr.Update();  //更新
        sceneMgr.Draw();    //描画
		fps();
		if(Keyboard_Get(KEY_INPUT_F1) == 1){
			debbattle = !debbattle;
		}
		if(debbattle){
		    DrawFormatString(0, 10,GetColor(255,255,255),"battle:true");
		}
		fpsc++;
	}

	sceneMgr.Finalize();
	DxLib_End();	// DXライブラリ終了処理
	return 0;
}
Ejemplo n.º 10
0
//	--------------------------------------------------------------------
//	プレイヤー、敵、弾、背景の描画処理を呼ぶ
//	--------------------------------------------------------------------
void DrawGame()
{
    // 画面を初期化
    ClearDrawScreen();

    // 描画先画面を裏にする
    SetDrawScreen( DX_SCREEN_BACK );

    //	背景描画
    DrawBG();

    //	プレイヤーの描画処理
    DrawObject(Player);
    //	プレイヤーの弾描画
    DrawObject(PlayerShot);

    //	敵の描画
    DrawObject(Enemy);
    //	敵の弾描画
    DrawObject(EnemyShot);

    //	裏画面に描いたものを表画面に反映する
    ScreenFlip();

    return;
}
Ejemplo n.º 11
0
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE);
	DxLib_Init();
	SetDrawScreen(DX_SCREEN_BACK);

	int handle = LoadGraph("image/backGround.png");

	GameManager *gameMgr;
	gameMgr = new GameManager();

	/*初期化処理*/
	gameMgr->initialize();

	while (!ProcessMessage() && !ScreenFlip() && !ClearDrawScreen())
	{
		/*キーボードアップデート*/
		KeyboardInput::Instance()->update();
		if (KeyboardInput::Instance()->get(KEY_INPUT_ESCAPE) == 1){ break; }


		DrawGraph(0, 0, handle, FALSE);

		/*メイン処理*/
		gameMgr->execute();

	}
	/*終了処理*/
	gameMgr->finalize();
	delete gameMgr;

	DxLib_End();

	return 0;
}
Ejemplo n.º 12
0
void sort(int bl[],int x){
	int tmp;//一時
	int cmp=0,swp=0;//比較、交換	
	int i, j;//ループ用
		
	for(i=0;i<x;i++){//x=20
		for(j=0;j<(x-1)-i;j++){
			SetDrawScreen(DX_SCREEN_BACK); // 描画先を裏画面へ
			ClsDrawScreen(); //裏画面消去
			cmp++;//比較+1			



			if(bl[j]>bl[j+1]){
				swp++;//交換+1
				tmp =bl[j];
				bl[j]=bl[j+1];
				bl[j+1]=tmp;
			}



			showHeader(cmp, swp);//ヘッダー表示
			showGraph(bl, ARRAY_SIZE, j);//表示

			//_sleep(10);

			ScreenFlip();                           // 裏画面を表画面へ
			

		}
	}
	///////////////////////////////////////////////

}
Ejemplo n.º 13
0
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) {

	SetMainWindowText( "LED ドットマトリックスカレンダー" );					// ウインドウタイトルの変更
    ChangeWindowMode( TRUE );							// ウィンドウモード
	SetGraphMode( 600, 540, 16 );						// ウィンドウサイズの変更
	SetOutApplicationLogValidFlag( false );				// ログを出力しない

	// DXライブラリの初期化
	if( DxLib_Init() == -1 ) {
		MessageBox(
			GetMainWindowHandle(),
			"DXライブラリの初期化に失敗しました。\nアプリケーションを終了します。",
			"エラーが発生しました",
			MB_OK + MB_ICONEXCLAMATION
			);
		return -1;
	}

	// 画面の描画先をリアバッファーに設定します。
	SetDrawScreen( DX_SCREEN_BACK );

	// ここから開始
	CalSystem cals;
	cals.CalMain();

	// DXライブラリ終了処理
	DxLib_End();

	return 0;
}
Ejemplo n.º 14
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
	LPSTR lpCmdLine, int nCmdShow)
{
	Application app;
	

	ChangeWindowMode(TRUE),
	SetGraphMode(Application::m_windowWidth,Application::m_windowHeight, 32);
	SetDrawScreen(DX_SCREEN_BACK);
	

	if (DxLib_Init() == -1)    // DXライブラリ初期化処理
	{
		return -1;
	}
	
	//CreateConsoleWindow();
	while (ScreenFlip() == 0 && ProcessMessage() == 0 &&
		ClearDrawScreen() == 0)
	{
		app.AppMain();
	}
	

	DxLib_End();
	CloseConsoleWindow();
	return 0;        // ソフトの終了
}
Ejemplo n.º 15
0
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ShowConsole();



	ChangeWindowMode(true);

	SetGraphMode(288, 512, 32);


	SetDrawScreen(DX_SCREEN_BACK);
	if (DxLib_Init() == -1)
	{
		printf("DxLib起動失敗!!");
		return -1;
	}

	m_pSceneManager = new SceneManager(key);

	m_pSceneManager->load();
	m_pSceneManager->init();

	while (ScreenFlip() == 0 && ProcessMessage() == 0 && getupKey() == 0)
	{
		ClearDrawScreen();

		m_pSceneManager->updata();

		if (key[KEY_INPUT_ESCAPE] == 1)break;
	}

	delete m_pSceneManager;
	return DxLib_End();
}
Ejemplo n.º 16
0
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){

	SetWindowText("Title");
	SetGraphMode(WINDOW_WIDTH , WINDOW_HEIGHT,32 );
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK );

	int LoadImage = LoadGraph("Natsuiro/BLOCK/load.png");
	DrawExtendGraph(0,0,WINDOW_WIDTH,WINDOW_HEIGHT, LoadImage ,false);
	ScreenFlip();
	
	SetTransColor(255,0,255);
	Awake();

	long long TIME = GetNowHiPerformanceCount();
#	if	BENCHMARK == TRUE
	long long int count = GetNowCount();
#	endif

	while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 && !CheckHitKey(KEY_INPUT_ESCAPE) ){
		GameLoop();
		Sleep( (unsigned long)max( 16 - (int)( GetNowHiPerformanceCount() - TIME ) / 1000 , 0 ) );
		TIME = GetNowHiPerformanceCount();

#		if BENCHMARK == TRUE
		DrawFormatString(WINDOW_WIDTH-200,0,BLACK,"FPS %d (%dms)", (int)( 1000/( GetNowCount() - count ) ) , GetNowCount() - count );
		count = GetNowCount();
#		endif

	}
        
	DxLib_End();
	return 0;
} 
Ejemplo n.º 17
0
//! DxLib公式ページからコピペしただけです。
// プログラムは WinMain から始まります
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

	//! ウィンドウモードで描画するように設定
	ChangeWindowMode(TRUE);

	//! ウィンドウサイズ、使用カラービット数の指定
	SetGraphMode(GameManager::WindowInformation::Width, GameManager::WindowInformation::Height, GameManager::WindowInformation::ColorBit);
	
	//! 描画先をバックバッファにする(後でScreenFlipによって表にする必要がある。)
	SetDrawScreen(DX_SCREEN_BACK);

	if (DxLib_Init() == -1)		// DXライブラリ初期化処理
	{
		return -1;			// エラーが起きたら直ちに終了
	}



	GameManager::GetInstance().Initialize();

	//メインループ
	while (ProcessMessage() == false && CheckHitKey(KEY_INPUT_ESCAPE) == FALSE)
	{

		GameManager::GetInstance().GameMainLoop();
	}


	DxLib_End();				// DXライブラリ使用の終了処理

	return 0;				// ソフトの終了 
}
Ejemplo n.º 18
0
// プログラムは WinMain から始まります
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	GameScene* mGameScene;		//ゲームシーンの作成 こいつが画面を見ている
	mGameScene = new GameScene;	//インスタンス生成 GameSceneのコンストラクタでタイトルシーンをを入れている
	
	SetGraphMode(640, 480, 16);	//画面の解像度
	ChangeWindowMode(TRUE);
	if (DxLib_Init() == -1)		// DXライブラリ初期化処理
	{
		return -1;			// エラーが起きたら直ちに終了
	}
	// 描画先画面を裏画面にセット
	SetDrawScreen(DX_SCREEN_BACK);
	// ループ
	while (ProcessMessage() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0)
	{
		// 画面を初期化する
		ClearDrawScreen();

		//画面動作処理
		mGameScene->Update();

		//画面描画処理
		mGameScene->Draw();

		// 裏画面の内容を表画面に反映させる
		ScreenFlip();
	}
	DxLib_End();				// DXライブラリ使用の終了処理
	return 0;				// ソフトの終了 
}
Ejemplo n.º 19
0
void GraphHue::LoadToMap(std::string name){
	std::string loadname = "ImagesHue/" + name;
	HandleArray hArray;
	int tmp_handle = LoadGraph(loadname.c_str());
	int sizeX, sizeY;
	GetGraphSize(tmp_handle, &sizeX, &sizeY);
	for (int i = 0; i < colorNum; i++){
		hArray.arr[i] = MakeScreen(sizeX, sizeY, TRUE);
		SetDrawScreen(hArray.arr[i]);
		int hue = i * 360 / colorNum;
		SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
		Func::SetDrawBrightHSV(hue, 140, 255);
		//5回描画することで半透明の黒っぽい部分を消す
		for (int i = 0; i < 5; i++){
			DrawGraph(0, 0, tmp_handle, TRUE);
		}
	}
	SetDrawBright(255, 255, 255);

	std::vector<std::string> extensionList = { ".png", ".jpg" };
	for (auto &i : extensionList){
		Func::strReplace(name, i, "");
	}

	handlemap.emplace(name, hArray);
}
Ejemplo n.º 20
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
	ChangeWindowMode(TRUE);
	SetGraphMode(WINDOW_X, WINDOW_Y, 32);
	if (DxLib_Init() == -1)return -1;
	SetDrawScreen(DX_SCREEN_BACK);

	//�錾
	GameManager *gm = new GameManager(WINDOW_X, WINDOW_Y);

	while (ProcessMessage() != -1) {
		int startTime = GetNowCount();
		ScreenFlip();
		ClearDrawScreen();

		//����
		gm->All();

		if (CheckHitKey(KEY_INPUT_ESCAPE) == 1)break;
		int endTime = GetNowCount();
		WaitTimer((1000 / 60) - (endTime - startTime));
	}

	delete gm;
	DxLib_End();

	return 0;
}
Ejemplo n.º 21
0
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
    ChangeWindowMode(TRUE);//ウィンドウモード
    if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化

    while(ProcessLoop()==0){//メインループ
        switch(func_state){
            case 0://初回のみ入る処理
                load();        //データロード
                first_ini();//初回の初期化
                func_state=99;
                break;
            case 99://STGを始める前に行う初期化
                ini();
                func_state=100;
                break;
            case 100://通常処理
                calc_ch();    //キャラクタ計算
                ch_move();    //キャラクタの移動制御
                enemy_main();//敵処理メイン
                graph_main();//描画メイン
                stage_count++;
                break;
            default:
                printfDx("不明なfunc_state\n");
                break;
        }
        if(CheckStateKey(KEY_INPUT_ESCAPE)==1)break;//エスケープが入力されたらブレイク
        ScreenFlip();//裏画面反映
    }
    DxLib_End();//DXライブラリ終了処理
    return 0;
}
Ejemplo n.º 22
0
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
    
    ChangeWindowMode(TRUE);//ウィンドウモード
    if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化

	int Menu = 1;
	load();
	ini();

    while(ProcessMessage()==0 && ClearDrawScreen()==0 && gpUpdateKey(Key)==0 && Key[KEY_INPUT_ESCAPE]==0){
          //↑メッセージ処理         ↑画面をクリア            ↑入力状態を保存       ↑ESCが押されていない

		if(Key[ KEY_INPUT_SPACE ]==1 || Key[ KEY_INPUT_RETURN ]==1)
         Menu = 2;

		switch(Menu){
		 case 1:back_graph();break;
		 case 2:main_graph();break;
		 }
        ScreenFlip();//裏画面反映関数
    }

    DxLib_End();//DXライブラリ終了処理
    return 0;
}
Ejemplo n.º 23
0
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE);
	DxLib_Init();
	SetDrawScreen(DX_SCREEN_BACK);

	Normal_Ball normalBall(3,4);
	Normal_Bar normalBar(5);

	normalBall.initialize();
	normalBar.initialize();

	while (!ProcessMessage() && !ScreenFlip() && !ClearDrawScreen())
	{
		KeyboardInput::Instance()->update();
		if (KeyboardInput::Instance()->get(KEY_INPUT_ESCAPE) == 1){ break; }

		normalBall.update();
		normalBar.update();

		normalBall.draw();
		normalBar.draw();
	}

	normalBall.finalize();
	normalBar.finalize();

	DxLib_End();

	return 0;
}
Ejemplo n.º 24
0
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){

		// DXライブラリ初期化
		ChangeWindowMode( TRUE ) ;
        if(DxLib_Init() == -1 ) 
		{
			return -1;
		}

		CShootingScene CShootingScene;
		SetDrawScreen( DX_SCREEN_BACK ) ;
		while(1)
		{		
			ClearDrawScreen();
			CShootingScene.DrawImage();
			ScreenFlip();			
			if( ProcessMessage() < 0 ) break ;
#ifdef _DEBUG
			if( CheckHitKey( KEY_INPUT_ESCAPE ) ) break ;
#endif
		}

		// DXライブラリ終了処理
        DxLib_End();
        return 0;
}
Ejemplo n.º 25
0
void p7(void) {

	SetDrawScreen(DX_SCREEN_BACK);

	int imgs[16];
	int x, y;
	MUKI muki;	//	Œü‚«
	int speed;	//	‘¬“x
	char keybuf[256];

	x = y = 0;
	muki = UP;
	speed = 10;
	LoadDivGraph("pic11.png", 16, 4, 4, 20, 20, imgs);

	while (ProcessMessage() == 0 && GetHitKeyStateAll(keybuf) == 0) {
		if (keybuf[KEY_INPUT_ESCAPE]) {
			break;
		}

		if (keybuf[KEY_INPUT_UP]) {
			y -= speed;
			muki = UP;
		}

		if (keybuf[KEY_INPUT_DOWN]) {
			y += speed;
			muki = DOWN;
		}

		if (keybuf[KEY_INPUT_LEFT]) {
			x -= speed;
			muki = LEFT;
		}

		if (keybuf[KEY_INPUT_RIGHT]) {
			x += speed;
			muki = RIGHT;
		}

		
		if (y < 0) {
			y = 0;
		} else if (y > 480 - 20) {
			y = 480 - 20;
		}
		if (x < 0) {
			x = 0;
		} else if (x > 640 - 20) {
			x = 640 - 20;
		}
		
		ClearDrawScreen();
		DrawGraph(x, y, imgs[muki * 4 + (x + y) / 20 % 4], TRUE);
		ScreenFlip();
	}
}
Ejemplo n.º 26
0
void dying::startdying(){		
	//ptr->mstr_log->add("死んでしまった。");
	ptr->mstr_log->addbigstr("YOU DIED...", "you can live eternally as zombie...");
	StopSoundMem(SHandle[90]);
	PlaySoundMem(SHandle[7], DX_PLAYTYPE_BACK );
	int x1 = (int)ptr->mplayer->x;
	int y1 = (int)ptr->mplayer->y;
	for(int i = 0; i < 30; i++){ ptr->meffect->make(x1, y1, 4, -1, -1);}
	SetDrawScreen( zanzou ) ;
	SetDrawBlendMode( DX_BLENDMODE_ALPHA , 200 ) ;
	for(int i = 0; i < 15; i++){
		double angle = PI * randarc();
		double rr = 30*randarc();
		DrawRotaGraph((int)(x1+rr*cos(angle)), (int)(y1+rr*sin(angle)), randarc()*1.0+0.7, PI*randarc(), GHandle[7], 1);
	}
	SetDrawBlendMode( DX_BLENDMODE_ALPHA , 255 ) ;
	SetDrawScreen( DX_SCREEN_BACK ) ;
}
Ejemplo n.º 27
0
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ){
	read_xml(CONFIG_FILE_NAME, gConfig);
	ChangeWindowMode(gConfig.get("WindowMode",true));
	SetMainWindowText( PJTITLE );
	if( DxLib_Init() == -1 ){
		 return -1;	// エラーが起きたら直ちに終了
	}
	LPCSTR font_path = "img\\font.ttf"; // 読み込むフォントファイルのパス
	AddFontResourceEx(font_path, FR_PRIVATE, NULL);
	ChangeFont("Neuropol",DX_CHARSET_DEFAULT);
	ChangeFontType( DX_FONTTYPE_ANTIALIASING_EDGE );
	shotButton = gConfig.get("Pad.Shot",PAD_INPUT_1);
	subButton = gConfig.get("Pad.Sub",PAD_INPUT_2);
	SetJoypadInputToKeyInput(DX_INPUT_PAD1, shotButton, gConfig.get("Key.Shot", KEY_INPUT_Z), -1, -1, -1 ) ;
	SetJoypadInputToKeyInput(DX_INPUT_PAD1, subButton, gConfig.get("Key.Sub", KEY_INPUT_X), -1, -1, -1 ) ;

	gGameManager.Set(&GameManager::Init);
	for(;;){ //メインループ
		//SetDrawScreen(DX_SCREEN_BACK);
		SetDrawScreen(gDrawScr);
		ClearDrawScreen();
		if(ProcessMessage()==-1 || GameMain()==1){break;} //ゲーム本体を実行
		SetDrawScreen( DX_SCREEN_BACK ) ; //裏スクリーンに描画対象を移す
		SetDrawBlendMode(DX_BLENDMODE_ALPHA,255);
		DrawGraph(0,0,gDrawScr,FALSE); //実際に描画
		SetDrawBlendMode(DX_BLENDMODE_NOBLEND,0);

		//FPS描画
		{
			int NowFPS = gFPS.Get();
			int Col = (int)(255 * NowFPS / gFPS.GetDefaultFPS());
			DrawFormatString(SCR_WIDTH-80,SCR_HEIGHT-20,GetColor(255,Col,Col),"%02dFPS",NowFPS);
		}
		ScreenFlip();
		CaptureScreen();
		gFPS.Fix();
	}

	DxLib_End() ;		// DXライブラリ使用の終了処理
	write_xml(CONFIG_FILE_NAME,gConfig);

	return 0 ;		// ソフトの終了
}
Ejemplo n.º 28
0
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int){
        ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen( DX_SCREEN_BACK ); //ウィンドウモード変更と初期化と裏画面設定

        while( ScreenFlip()==0 && ProcessMessage()==0 && ClearDrawScreen()==0 ){

                //ここに処理を追加

        }
        
        DxLib_End(); // DXライブラリ終了処理
        return 0;
}
Ejemplo n.º 29
0
	void resize(const uint32 width, const uint32 height)
	{
		dxlib_handle screen = MakeScreen(width, height, true);



		auto _ = GetDrawScreen();


		SetDrawScreen(screen);

		DrawExtendGraph(0, 0, width, height, handle, true);

		SetDrawScreen(_);


		DeleteGraph(handle);

		handle = screen;

	}
Ejemplo n.º 30
0
void Ienemy::Isdead(){
	if (hp < 0.1){
		for (int i = 0; i < 10; i++){
			manager::get().effect_.add<enemy_bloodsplash>(x, y);
		}
		SetDrawScreen(Screen::get().blood);
		for (int i = 0; i < 5; i++){
			double dx, dy;
			Random::RandInCircle(32, dx, dy);
			Draw_::exrot(x + dx, y + dy, Random::FRand(0.5, 1.5), Random::FRadRand(), Graph::handle("blood01"), 255);
		}
		SetDrawScreen(DX_SCREEN_BACK);

		Sound::playback("enemydead");
		deadlog();
		addscore();
		deleteflag = true;
	}
	if (x < -300){
		deleteflag = true;
	}
}