main.cpp
#include"DxLib.h"
#include"../ヘッダ/back.h"
#include"../ヘッダ/Player.h"
int WINAPI WinMain( HINSTANCE, HINSTANCE,LPSTR, int ){
ChangeWindowMode(TRUE);
back_load();
Player_load();
if(DxLib_Init()==-1 || SetDrawScreen(DX_SCREEN_BACK)!=0) return -1;
while(ScreenFlip()==0&&ProcessMessage()==0 && ClearDrawScreen()==0 ){
back_graph();
Player_graph();
}
back_delete();
Player_delete();
DxLib_End();
return 0;
}
#include"DxLib.h"
#include"../ヘッダ/Player.h"
static int player_p;
void Player_load(){
player_p=LoadGraph("../画像/自機.png");
}
void Player_graph(){
DrawGraph(1,1,player_p,TRUE);
}
void Player_delete(){
DeleteGraph(player_p);
}
#ifndef DEF_PLAYER_H
#define DEF_PLAYER_H
void Player_load();
void Player_graph();
void Player_delete();
#endif
#include"DxLib.h"
#include"../ヘッダ/back.h"
static int back_p;
void back_load(){
back_p=LoadGraph("../画像/背景.png");
}
void back_graph(){
DrawGraph(0,0,back_p,TRUE);
}
void back_delete(){
DeleteGraph(back_p);
}