DxLib做弹幕射击游戏(二)——画一台敌机
直接看代码:
#include "DxLib.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
ChangeWindowMode( TRUE ) ;
if( DxLib_Init() == -1 ){return -1 ;}
int gh ;//图像编号
int x, y;//坐标
x = 200;
y = 150;
gh = LoadGraph( "chip.bmp" ) ;//载入图片
DrawGraph( x, y , gh , TRUE) ;//在窗口的x,y坐标画图片。
//参数四表示图像黑色部分是否透明,TRUE表示透明,FALSE不透明
WaitKey() ;
DxLib_End() ;
return 0 ;
}
代码是不是很简单?
没找到啥好照片,用姚明替代吧,嘿嘿。
练习作业:请在窗口上画四个图片。相信对你来说是很简单的任务!