Ejemplo n.º 1
0
void Button::load(const char* active, const char* push, const char* inactive)
{
	graphHandle[Active]   = LoadGraph(active);
	graphHandle[Inactive] = LoadGraph(inactive);
	graphHandle[Push]     = LoadGraph(push);
	GetGraphSize(graphHandle[Active], &size.width, &size.height);
}
Ejemplo n.º 2
0
//3次元回転描画
void DrawImpl::rot3D(const Vector2& pos, const Vector2& exRate, float zRot, float xRot, float yRot, int gHandle, int turnFlag){
	MATRIX m;
	int w, h;
	GetGraphSize(gHandle, &w, &h);
	w = (int)(w*exRate.x);
	h = (int)(h*exRate.y);
	if (turnFlag == TRUE)
		w *= -1;
	VECTOR v[4] = { VGet(-(float)w / 2, -(float)h / 2, 0), VGet((float)w / 2, -(float)h / 2, 0)
		, VGet(-(float)w / 2, (float)h / 2, 0), VGet((float)w / 2, (float)h / 2, 0) };

	m = MGetRotZ(zRot);
	for (int i = 0; i < 4; i++)
		v[i] = VTransform(v[i], m);
	if (xRot != 0.0f)
	{
		m = MGetRotX(xRot);
		for (int i = 0; i < 4; i++)
			v[i] = VTransform(v[i], m);
	}
	if (yRot != 0.0f)
	{
		m = MGetRotY(yRot);
		for (int i = 0; i < 4; i++)
			v[i] = VTransform(v[i], m);
	}

	DrawModiGraphF(pos.x + v[0].x, pos.y + v[0].y, pos.x + v[1].x, pos.y + v[1].y, pos.x + v[3].x, pos.y + v[3].y, pos.x + v[2].x, pos.y + v[2].y, gHandle, TRUE);
}
Ejemplo n.º 3
0
void Image::DrawRotaImageF(float x, float y, double ExRate, double Angle, int GrIndex, bool TransFlag, int div, bool adj, bool corner)
{
	Image_t* img = img_db.QueryImgData(GrIndex);
	if(div > img->div_num-1) div = img->div_num-1; 

	float draw_x = x;
	float draw_y = y;

	if(corner){
		int img_w, img_h;
		GetImageSize(GrIndex, &img_w, &img_h);

		draw_x+=(float)img_w/2;
		draw_y+=(float)img_h/2;
	}

	if(adj){
		draw_x += GAME_X;
		draw_y += GAME_Y;
	}


	int img_w, img_h;
	GetGraphSize(img->img_han,&img_w,&img_h);
	int per_w = img_w/img->div_num;

	SetDrawMode(DX_DRAWMODE_BILINEAR);
	DrawRectRotaGraphF(draw_x,draw_y,per_w*div,0,per_w,img_h,ExRate,Angle,img->img_han,TransFlag,FALSE);
	SetDrawMode(DX_DRAWMODE_NEAREST);
}
Ejemplo n.º 4
0
//@Anten,@Meiten,@BackGround_Change用のフェードインアウト処理
void CWorldManager::FadeDraw(int _time, int _img, bool _changeahead, bool _color){
    int starttime = GetNowCount() ;
	int alpha;

	if (!_color && !_changeahead) {int tmp = _img; _img = ImgBackGround; ImgBackGround = tmp;}

    while(GetNowCount()-starttime<_time){
		if (_changeahead){
			alpha = 255 * (GetNowCount()-starttime)/_time;
		}else{
			alpha = 255 - 255 * (GetNowCount()-starttime)/_time;
		}
		
		SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );	
		Draw(false, true);		//Draw()内でScreenFlipなどはしない

		SetDrawBlendMode( DX_BLENDMODE_ALPHA, alpha);
		if (_color){
			DrawBox(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, _img, true);	//DrawBox使わない方が軽いらしい$
		}else{
			CVector picsize = GetGraphSize(_img);
			DrawGraph(WINDOW_WIDTH/2-picsize.x/2, WINDOW_HEIGHT/2-picsize.y/2, _img, true);
		}

		if(!BasicLoop() ) break;
	}
	
	if (!_color && _changeahead) ImgBackGround = _img;
	SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );	
}
Ejemplo n.º 5
0
bool CEnemy::Appear(CEnemy *Model, Vector _pos, int _timecount, int _rand, int _momstar){
		
	MoveType = Model->MoveType;
	BallType = Model->BallType;
	Hp = Model->Hp;
	Elements = Model->Elements;
	MomStar = _momstar;

	ShootTime = Model->ShootTime;
	AliveTime = Model->AliveTime;
	AppearTime = _timecount;

	ImgEnemy[0] = Model->ImgEnemy[0];
	ImgEnemy[1] = Model->ImgEnemy[1];
	ImgEnemy[2] = Model->ImgEnemy[2];
	GetGraphSize(ImgEnemy[0], &PicSizeX, &PicSizeY);

	Radius = Model->Radius;
	Pos.x = _pos.x + (_rand % 81) - 40;
	Pos.y = _pos.y + (_rand % 83) - 41;
	
	MaxSpeed = Model->MaxSpeed;
	Velocity.Set(_rand%51-25, _rand%53-26);
	Velocity.Multiple(MaxSpeed / Velocity.GetLength());

		if(MoveType == 4){
			Pos = _pos;
			Velocity.Set(MaxSpeed,0);
			//AngleSpeed = 2*PI / (_rand%480 + 240);
		}


	Alive=TRUE;
	return TRUE;
}
Ejemplo n.º 6
0
	/// <summary> 画像のサイズを取得します </summary>
	Size<uint32> getSize()
	{
		int width, height;
		GetGraphSize(handle, &width, &height);

		return Size<uint32>(width, height);
	}
Ejemplo n.º 7
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.º 8
0
Player02Supporter::Player02Supporter(int imageHandle, Vector& position) :
m_position(position),
m_angle(0.0f)
{
	m_image.handle = imageHandle;
	GetGraphSize(m_image.handle, &m_image.width, &m_image.height);
	m_image.scaleRate = 0.6;
}
Ejemplo n.º 9
0
bool MapTask::Init()
{
	int Sizex, Sizey, Gr;
	Gr = LoadGraph(ID.c_str());
	GetGraphSize(Gr, &Sizex, &Sizey);
	LoadDivGraph(ID.c_str(), (Sizex * Sizey)/(32 * 32), Sizex/32, Sizey/32, 32, 32, GraphHandle);
	return true;
}
Ejemplo n.º 10
0
void Normal_Ball::initialize()
{
	m_handle = LoadGraph("image/‹….png");
	GetGraphSize(m_handle, &m_imageWidth, &m_imageHeight);

	m_position.setX(SCREEN_WIDTH / 2 - m_imageWidth);
	m_position.setY(SCREEN_HEIGHT - m_imageHeight * 2);
}
Ejemplo n.º 11
0
void AObject::GetObjectSize(){
	int sizeX=0,sizeY=0;
	int* p_sizeX = &sizeX;
	int* p_sizeY = &sizeY;
	GetGraphSize(graphic_handle_,p_sizeX,p_sizeY);
	size_.x = *p_sizeX;
	size_.y = *p_sizeY;
}
Ejemplo n.º 12
0
OpeningScreen::OpeningScreen( int width, int height ) {
    m_width = width;
    m_height = height;

    m_titleImg = LoadGraph( "C:/Users/babakou/Works/Renda/bmp/TitlePlate.jpg" );

    int titleWidth = 0;
    int titleHeight = 0;
    GetGraphSize( m_titleImg, &titleWidth, &titleHeight );
    m_titleLetterLocation_x = (width / 2) - (titleWidth / 2);
    m_titleLetterLocation_y = (height / 2) - (titleHeight / 2);
}
Ejemplo n.º 13
0
void CObject_Bg_Stage4_5::Render()
{
	int _width = 0;
	int _height = 0;

	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	GetGraphSize(GraphHandle, &_width, &_height); 

	DrawRectGraph((int)fDrawX, (int)fDrawY, SrcX, SrcY, 1024, 768, GraphHandle, TRUE, FALSE);
	DrawRectGraph((int)fDrawX, (int)fDrawY, (SrcX-_width), SrcY+768, 1024, 768, GraphHandle, TRUE, FALSE);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Ejemplo n.º 14
0
void graph_logo() {
	int Alpha;

	DrawBox(0,0,640,480,GetColor(255,255,255),TRUE);
	if (exe_cnt<30) {
		Alpha=(int)(255/30*exe_cnt);
	} else if (exe_cnt<210) {
		Alpha=255;
	} else if (exe_cnt<240) {
		Alpha=(int)(255/30*(240-exe_cnt));
	} else {
		func_state=50;
		return;
	}

	SetDrawBlendMode( DX_BLENDMODE_ALPHA , Alpha );
	GetGraphSize(img_menu[0][0],&temp[0],&temp[1]);
	DrawGraph(320-temp[0]/2,200,img_menu[0][0],TRUE);
	GetGraphSize(img_menu[0][1],&temp[0],&temp[1]);
	DrawGraph(320-temp[0]/2,260,img_menu[0][1],TRUE);
	SetDrawBlendMode( DX_BLENDMODE_NOBLEND , 0 );
}
Ejemplo n.º 15
0
void CObject_Bg_Stage1_2::Render()
{
	int _width = 0;
	int _height = 0;

	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
	GetGraphSize(GraphHandle, &_width, &_height); 

	DrawRectGraph((int)fDrawX, (int)fDrawY, SrcX, SrcY, 1024, 768, GraphHandle, TRUE, FALSE);
	DrawRectGraph((int)fDrawX, (int)fDrawY, (SrcX-_width), SrcY+768, 1024, 768, GraphHandle, TRUE, FALSE);
	
	SetDrawBlendMode(DX_BLENDMODE_ALPHA, Hero->GetOpacity());
	DrawGraphF(1160 - SrcX, 180, GetResourceWithKey(IMAGE_STAGE1_2_FOREST), TRUE);
	
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 255);
}
Ejemplo n.º 16
0
void Graphics2D::DrawRasterScroll(const int& X, const int& Y, double Cycle, double Shake, const int& Gr_Handle, bool isVertical)
{
	int Width = 0, Height = 0;					// 画像の横幅と縦幅
	static int Correction = 0;					// ラスタースクロールの補正

	GetGraphSize(Gr_Handle, &Width, &Height);	// 画像のサイズを得る

	switch (isVertical)
	{
	case true :
		for (int I = 0; I < Height; ++I)
		{
			const int& DestX = X - Width / 2 + std::cos((I + Correction) / 180.0 * DX_PI * Cycle) * Shake;	// cosの値で左右に揺らす
			const int& DestY = Y - Height / 2 + I;

			// 画像の分割描画(縦に1pixずつ)
			DrawRectGraph(
				DestX, DestY,
				0, I,
				Width, 1,
				Gr_Handle,
				TRUE, FALSE
				);
		}	break;

	case false :
		for (int I = 0; I < Width; ++I)
		{
			const int& DestX = X - Width / 2 + I;
			const int& DestY = Y - Height / 2 + std::cos((I + Correction) / 180. * DX_PI * Cycle) * Shake;

			// 画像の分割描画(横に1pixずつ)
			DrawRectGraph
				(
					DestX, DestY,
					I, 0,
					1, Height,
					Gr_Handle,
					TRUE, FALSE
				);
		}

		break;
	}

	++Correction;
}
Ejemplo n.º 17
0
void Effect_DescapePreEnd_RightPic::draw_over() {
	SetDrawArea(ShootingScreenRightX, 0, ScreenSizeX, ScreenSizeY);//描画範囲を右画面だけに
	int size_x;
	int size_y;
	BlendModeManager::get().ChangeDrawBlendMode(DX_BLENDMODE_ALPHA, 50 - time_by_gene / 4);//アルファブレンドに変更
	GetGraphSize(got_graphic_handle, &size_x, &size_y);

	DrawRotaGraph(x + size_x / 2, y + size_y / 2, extend_rate, 0, got_graphic_handle, 1);
	DrawRotaGraph(x + size_x / 2, y + size_y / 2, pre_extend_rate[2], 0, got_graphic_handle, 1);
	DrawRotaGraph(x + size_x / 2, y + size_y / 2, pre_extend_rate[4], 0, got_graphic_handle, 1);


	BlendModeManager::get().ChangeToPreDrawBlendMode();//ブレンドモードを元に戻す
	SetDrawArea(0, 0, ScreenSizeX, ScreenSizeY);//描画範囲を全体に戻す

												//	printfDx("descapeeffect draw\n");
}
Ejemplo n.º 18
0
int Font::CalculateWidth(int x,int y,int Space,float ext,const char* String,int FontIndex)
{
	int StrLen = strlen(String);
	int Img = 0;
	int x_Pos = x;
	int y_Pos = y;
	int Width = 0;
	int Height = 0;
	int ImgWidth = 0;
	int AverageSpace = Space;
	for(int i=0;i<StrLen;i++)
	{
		char Alphabet = String[i];
		//改行判定
		if(Alphabet == '\\')
		{
			x_Pos = ImgWidth;
			x_Pos = x;
			y_Pos += Height + Space;
			continue;
		}
		//指定文字の画像を読み込む
		if(String[i] == ' ')goto Blank;
		
		Img = FontData[FontIndex][Alphabet-'A'];

		//描画
		if(Img)
		{
			GetGraphSize(Img,&Width,&Height);
			Width = (int)(Width * ext);
			Height = (int)(Height * ext);
			//DrawRotaGraph2(x_Pos,y_Pos,0,0,ext,0,Img,true);
			//次の描画位置を指定
			x_Pos += Width + Space;
		}else
		{//ブランク挿入
			Blank:;
			x_Pos += AverageSpace;
		}
		AverageSpace = (AverageSpace + Width) / 2;
	}
	if(ImgWidth < x_Pos)ImgWidth = x_Pos;
	return ImgWidth;
}
Ejemplo n.º 19
0
void Image::DrawImage(int x, int y, int GrIndex, bool TransFlag, int div, bool adj)
{
	Image_t* img = img_db.QueryImgData(GrIndex);
	if(div > img->div_num-1) div = img->div_num-1; 

	int adj_x = GAME_X;
	int adj_y = GAME_Y;
	if(!adj) {
		adj_x = 0;
		adj_y = 0;
	}	

	int img_w, img_h;
	GetGraphSize(img->img_han,&img_w,&img_h);
	int per_w = img_w/img->div_num;

	DrawRectGraph(x+adj_x,y+adj_y,per_w*div,0,per_w,img_h,img->img_han,TransFlag,FALSE);
}
Ejemplo n.º 20
0
// ハンドルのSet
void DrawableImage::setHandle(const int handle){
    int result;

    // 渡されたハンドルのチェック
    assert("error imageHandle: handle == -1" && handle != -1);

    // ハンドルの設定
    m_handle = handle;

    // 画像の大きさの取得と表示領域を最大に設定
    result = GetGraphSize(m_handle, &m_srcWidth, &m_srcHeight);
    assert(!result && "Error GetGraphSize()");
    m_width = m_srcWidth;
    m_height = m_srcHeight;

    // Visibleに設定
    setIsVisible(true);
}
Ejemplo n.º 21
0
int CItem::Set_Item(int x,int y,int *glaphic_id,int pattern,int spead,int kouka)
{
	if(item_max<=max)
	{
		return 2;//最大数を超えています
	}
	item[max].x=x;
	item[max].y=y;
	item[max].Glaphic=*glaphic_id;
	GetGraphSize( *glaphic_id , &item[max].g_w , &item[max].g_h ) ;
	item[max].spead=spead;
	item[max].kouka=kouka;
	item[max].pattern=pattern;

	max++;
	return 0;
	
}
Ejemplo n.º 22
0
void Image::DrawRotaImage(int x, int y, double ExRate, double Angle, int GrIndex, bool TransFlag, int div, bool adj, bool corner)
{
	Image_t* img = img_db.QueryImgData(GrIndex);
	if(div > img->div_num-1) div = img->div_num-1; 

	int draw_x = x;
	int draw_y = y;

	if(corner){
		int img_w, img_h;
		GetImageSize(GrIndex, &img_w, &img_h);

		draw_x+=img_w/2;
		draw_y+=img_h/2;
	}

	if(adj){
		draw_x = GAME_X;
		draw_y = GAME_Y;
	}


	int img_w, img_h;
	GetGraphSize(img->img_han,&img_w,&img_h);
	int per_w = img_w/img->div_num;

	DrawRectRotaGraph(draw_x,draw_y,per_w*div,0,per_w,img_h,ExRate,Angle,img->img_han,TransFlag,FALSE);

/*
	Image_t* img = img_db.QueryImgData(GrIndex);
	if(div > img->div_num-1) div = img->div_num-1; 

	int adj_x = GAME_X;
	int adj_y = GAME_Y;
	if(!adj) {
		adj_x = 0;
		adj_y = 0;
	}

	DrawRotaGraph(x+adj_x, y+adj_y, ExRate, Angle, img->img_han,TransFlag);
*/
}
Ejemplo n.º 23
0
void Image::DrawImageF(float x, float y, int GrIndex, bool TransFlag, int div, bool adj)
{
	Image_t* img = img_db.QueryImgData(GrIndex);
	if(div > img->div_num-1) div = img->div_num-1; 

	float adj_x = GAME_X;
	float adj_y = GAME_Y;
	if(!adj) {
		adj_x = 0;
		adj_y = 0;
	}

	int img_w, img_h;
	GetGraphSize(img->img_han,&img_w,&img_h);
	int per_w = img_w/img->div_num;

	SetDrawMode(DX_DRAWMODE_BILINEAR);
	DrawRectGraphF(x+adj_x,y+adj_y,per_w*div,0,per_w,img_h,img->img_han,TransFlag,FALSE);
	SetDrawMode(DX_DRAWMODE_NEAREST);
}
Ejemplo n.º 24
0
void Graphics2D::Raster_Scroll(const int &X, const int &Y, const int &Gr_Handle, double Cycle,  double Shake)
{
	int Width = 0, Height = 0;	// 画像の横幅と縦幅
	int Correction = 0;			// ラスタースクロールの補正

	GetGraphSize(Gr_Handle, &Width, &Height);

	for (int I = 0; I < Height; ++I)
	{
		const int DestX = X - Width / 2 + std::cos((I + Correction) / 180.0 * DX_PI * Cycle) * Shake;
		const int DestY = Y - Height / 2 + I;

		DrawRectGraph
		(
			DestX, DestY,
			0, I,
			Width, 1,
			Gr_Handle,
			TRUE, FALSE
		);
	}

	++Correction;
}
Ejemplo n.º 25
0
void CImageObject::SetImageID(int imageID)
{
	m_ImageID = imageID;
	GetGraphSize(imageID, &m_Width, &m_Height);
}
Ejemplo n.º 26
0
void Image::GetImageSize(int index, int *BufXSize, int *BufYSize)
{
	Image_t* img = img_db.QueryImgData(index);

	GetGraphSize(img->img_han, BufXSize, BufYSize);
}
Ejemplo n.º 27
0
// WinMain関数
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
					 LPSTR lpCmdLine, int nCmdShow )
{
	int BallX , BallY , BallGraph ;
	int SikakuX , SikakuY , SikakuMuki , SikakuGraph ;
	int ShotX , ShotY , ShotFlag , ShotGraph ;

	// 画面モードの設定
	SetGraphMode( 640 , 480 , 16 ) ;

	// DXライブラリ初期化処理
	if( DxLib_Init() == -1 ) return -1;

	// グラフィックの描画先を裏画面にセット
	SetDrawScreen( DX_SCREEN_BACK ) ;

	// ボール君のグラフィックをメモリにロード&表示座標をセット
	BallGraph = LoadGraph( "Gewy001.bmp" ) ;
	BallX = 288 ; BallY = 400 ;

	// 四角君のグラフィックをメモリにロード&表示座標をセット
	SikakuGraph = LoadGraph( "背景1.bmp" ) ;
	SikakuX = 0 ; SikakuY = 0 ;

	// 弾のグラフィックをメモリにロード
	ShotGraph = LoadGraph( "Gewyの弾�A.bmp" ) ;

	// 弾が画面上に存在しているか保持する変数に『存在していない』を意味する0を代入しておく
	ShotFlag = 0 ;

	// 四角君の移動方向をセット
	SikakuMuki = 1 ;

	// 移動ルーチン
	while( 1 )
	{
		// 画面を初期化(真っ黒にする)
		ClearDrawScreen() ;
				// 四角君の移動ルーチン
		{
			// 四角君の座標を移動している方向に移動する
			if( SikakuMuki == 1 ) SikakuX += 0 ;
			if( SikakuMuki == 0 ) SikakuX -= 0 ;

			// 四角君が画面右端からでそうになっていたら画面内の座標に戻してあげ、移動する方向も反転する
			if( SikakuX > 576 )
			{
				SikakuX = 576 ;
				SikakuMuki = 0 ;
			}

			// 四角君が画面左端からでそうになっていたら画面内の座標に戻してあげ、移動する方向も反転する
			if( SikakuX < 0 )
			{
				SikakuX = 0 ;
				SikakuMuki = 1 ;
			}

			// 四角君を描画
			DrawGraph( SikakuX , SikakuY , SikakuGraph , true ) ;
		}

		// ボール君の操作ルーチン
		{
			// ↑キーを押していたらボール君を上に移動させる
			if( CheckHitKey( KEY_INPUT_UP ) == 1 ) BallY -= 1 ;

			// ↓キーを押していたらボール君を下に移動させる
			if( CheckHitKey( KEY_INPUT_DOWN ) == 1 ) BallY += 1 ;

			// ←キーを押していたらボール君を左に移動させる
			if( CheckHitKey( KEY_INPUT_LEFT ) == 1 ) BallX -= 1 ;

			// →キーを押していたらボール君を右に移動させる
			if( CheckHitKey( KEY_INPUT_RIGHT ) == 1 ) BallX += 1 ;

			// スペースキーを押していて、且弾が撃ち出されていなかったら弾を発射する
			if( CheckHitKey( KEY_INPUT_SPACE ) == 1 && ShotFlag == 0 )
			{
				int Bw, Bh, Sw, Sh ;

				// ボール君と弾の画像のサイズを得る
				GetGraphSize( BallGraph , &Bw , &Bh ) ;
				GetGraphSize( ShotGraph , &Sw , &Sh ) ;

				// 弾の位置をセット、位置はボール君の中心にする
				ShotX = ( Bw - Sw ) / 2 + BallX ;
				ShotY = ( Bh - Sh ) / 2 + BallY ;

				// 弾は現時点を持って存在するので、存在状態を保持する変数に1を代入する
				ShotFlag = 1 ;
			}

			// ボール君が画面左端からはみ出そうになっていたら画面内の座標に戻してあげる
			if( BallX < 0 ) BallX = 0 ;

			// ボール君が画面右端からはみ出そうになっていたら画面内の座標に戻してあげる
			if( BallX > 640 - 64 ) BallX = 640 - 64  ;

			// ボール君が画面上端からはみ出そうになっていたら画面内の座標に戻してあげる
			if( BallY < 0 ) BallY = 0 ;

			// ボール君が画面下端からはみ出そうになっていたら画面内の座標に戻してあげる
			if( BallY > 480 - 64 ) BallY = 480 - 64 ;

			// ボール君を描画
			DrawGraph( BallX , BallY , BallGraph , true ) ;
		}

		// 自機の弾の移動ルーチン( 存在状態を保持している変数の内容が1(存在する)の場合のみ行う )
		if( ShotFlag == 1 )
		{
			// 弾を16ドット上に移動させる
			ShotY -= 16 ;

			// 画面外に出てしまった場合は存在状態を保持している変数に0(存在しない)を代入する
			if( ShotY < -80 )
			{
				ShotFlag = 0 ;
			}

			// 画面に弾を描画する
			DrawGraph( ShotX , ShotY , ShotGraph , true ) ;
		}

		// 裏画面の内容を表画面にコピーする
		ScreenFlip() ;


		// Windows 特有の面倒な処理をDXライブラリにやらせる
		// -1 が返ってきたらループを抜ける
		if( ProcessMessage() < 0 ) break ;

		// もしESCキーが押されていたらループから抜ける
		if( CheckHitKey( KEY_INPUT_ESCAPE ) ) break ;
	}

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

	return 0 ;					// ソフトの終了
}
Ejemplo n.º 28
0
Image::Image(const char* filename, double baseExtendRate) : mDivFlag(false), mAnimeFlag(false), mTurnFlag(false), mEffectCount(0) {
	mFileName = filename;
	mBaseHandle = LoadGraph(mFileName);
	GetGraphSize(mBaseHandle,&mBaseWidth,&mBaseHeight);
	mBaseExtendRate=baseExtendRate;
}
Ejemplo n.º 29
0
int SecondIni(Character_t Substituted, int i){
	GetGraphSize( Substituted.Graph, &width[i], &heith[i]);
	return 0;
}
Ejemplo n.º 30
0
int Main()
{
	int Color;
	
	int check_data[] =
	{
		10.0, 15.0, 20, 25, 30, 40,
	};
		
	PlayerGraph = LoadGraph("human.png");
	BallGraph = LoadGraph("0055.png");
	BackGraph = LoadGraph("");
	
	Color = GetColor(255, 255, 255);
	
	GetGraphSize(PlayerGraph, &PlayerSizeX, &PlayerSizeY);
	GetGraphSize(BallGraph, &BallSizeX, &BallSizeY);
	
	PlayerX = 0;
	PlayerY = 325;
	
	BallX = 0;
	BallY = 50;
	
	Second = 0;
    Minute = 0;
    Hour = 0;
    
    Index = 0;
    
	SetDrawScreen(DX_SCREEN_BACK);
	
	while(ProcessMessage()==0 && CheckHitKey(KEY_INPUT_ESCAPE)==0)
	{
		int Key;
		
		Key = GetJoypadInputState(DX_INPUT_KEY_PAD1);
		
		playertop = PlayerY ;
    	playerbottom = PlayerY + PlayerSizeY;
	    playerleft = PlayerX ;
	    playerright = PlayerX + PlayerSizeX;
	    
	    balltop    = BallY ;
	    ballbottom = BallY + BallSizeY;
	    ballleft   = BallX ;
	    ballright  = BallX + BallSizeX;
	    
	    
				
		ClsDrawScreen();
		
		if(Key & PAD_INPUT_LEFT)
		{
			PlayerX -= 4;
		}
		
		if(Key & PAD_INPUT_RIGHT)
		{
			PlayerX += 4;
		}
		
		if(PlayerX < LEFT_EDGE)
		{
			PlayerX = LEFT_EDGE;
		}
		
		if(PlayerX > RIGHT_EDGE)
		{
			PlayerX = RIGHT_EDGE;
		}
		
		BallX += BallVx;
		BallY += BallVy;
		
		if(BallX < LEFT_EDGE)
		{
			BallX = LEFT_EDGE;
			BallVx = -BallVx;
		}
		
		if(BallX  > RIGHT_EDGE)
		{
			BallX = RIGHT_EDGE;
			BallVx = -BallVx;
		}
		
		if(BallY > BOTTOM)
		{
			BallY = BOTTOM;
			BallVy = -BallVy;
		}
		
		if(BallY < 0)
		{
			BallY = 0;
			BallVy = -BallVy;
		}
		
			
		Time();
		
		if(Minute==check_data[Index])
		{
			if(BallVx < 0)
			{
				BallVx -= 1;
			}
			
			if(BallVx > 0)
			{
				BallVx += 1; 
			}
			
			if(BallVy < 0)
			{
				BallVy -= 1;
			}
			
			if(BallVy > 0)
			{
				BallVy += 1;
			}
			
			Index++;
		}
		
		Temp();
		
	   if(playertop < ballbottom &&
	      playerbottom > balltop &&
	      playerleft < ballright &&
	      playerright > ballleft )
	   {
		return 0;
	  }
	
		
		//DrawFormatString(50, 50, Color, "Temp; %2f", Temperature);
		
		DrawGraph(PlayerX, PlayerY, PlayerGraph, TRUE);
		
		DrawGraph(BallX, BallY, BallGraph, TRUE);
		
		DrawGraph(0, 0, BackGraph, TRUE);
		
		DrawBox(playerleft, playertop, playerright, playerbottom, Color, TRUE); 

        DrawBox(ballleft, balltop, ballright, ballbottom, Color, TRUE); 
		
		ScreenFlip();
	}
}