소개글
제가 직접 만들었으면 많은 기능을 더 넣고 싶었지만시간이 없어서 다양한 기능은 없지만 그래도 어느정도
게임의 기초로 만들어 봤습니다. 잘부탁합니다.
본문 예제
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#define STRICT
#define WIN32_LEAN_AND_MEAN
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0900
#endif
#include
#include
#include
#include
static int i,j,ani_cont;
int old_time,new_time;
#define RELEASE(o){if(o) o->Release(); o=NULL;}
LPCSTR lpszClassName="BaseClass";
#define CAPTION "Sprite"
#define WIDTH 640
#define HEIGHT 440//181,81
#define DX_FULLSCREEN false
HWND hWnd;
LPDIRECT3D9 g_pD3D = NULL;
LPDIRECT3DDEVICE9 g_pd3dDevice= NULL;
LPDIRECT3DTEXTURE9 g_l_charac = NULL;
LPDIRECT3DTEXTURE9 g_l_background= NULL;
LPDIRECT3DTEXTURE9 g_l_roof[4];
LPDIRECT3DTEXTURE9 g_l_score[10];
LPDIRECT3DTEXTURE9 g_l_gameover;
LPDIRECT3DTEXTURE9 g_l_boll = NULL;
LPDIRECT3DTEXTURE9 g_l_die = NULL;
LPD3DXSPRITE g_pSprite = NULL;
float cx, cy, gx[4],gy[4],bx[20] ,by[20],bx2[20] ,by2[20],pit_x[5],scox[10],scoy[10],ovx,ovy;
int me_charac,me_boll[20],me_boll2[20];
int pi[5]={5,5,5,5,5};
char score[10] = "0";
D3DXVECTOR3 g_background;
D3DXVECTOR3 g_d_die;
D3DXVECTOR3 g_d_charac;
D3DXVECTOR3 g_d_gameover;
D3DXVECTOR3 g_d_roof[4];
D3DXVECTOR3 g_d_score[10];
D3DXVECTOR3 g_d_boll[20];
D3DXVECTOR3 g_d_boll2[20];
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
컴파일 실행환경
DirectX SDK, Visual studio압축파일 내 파일목록
a.bmp
a1.bmp
back.bmp
boll.bmp
die.bmp
gameOver.bmp
game_11_6.dsp
game_11_6.dsw
game_11_6.ncb
game_11_6.opt
game_11_6.plg
ground11.bmp
ground12.bmp
ground13.bmp
ground14.bmp
main.cpp
score0.bmp
score1.bmp
score2.bmp
score3.bmp
score4.bmp
score5.bmp
score6.bmp
score7.bmp
score8.bmp
score9.bmp
main.dsp
main.ncb
main.plg
main.opt
main.dsw
Debug/a1.bmp
Debug/back.bmp
Debug/boll.bmp
Debug/Debug.zip
Debug/die.bmp
Debug/gameOver.bmp
Debug/game_11_6.bsc
Debug/game_11_6.exe
Debug/game_11_6.ilk
Debug/game_11_6.pch
Debug/game_11_6.pdb
Debug/ground11.bmp
Debug/ground12.bmp
Debug/ground13.bmp
Debug/ground14.bmp
Debug/main.sbr
Debug/score0.bmp
Debug/score1.bmp
Debug/score2.bmp
Debug/score3.bmp
Debug/score4.bmp
Debug/score5.bmp
Debug/score6.bmp
Debug/score7.bmp
Debug/score8.bmp
Debug/score9.bmp
Debug/vc60.idb
Debug/vc60.pdb
a1.bmp
back.bmp
boll.bmp
die.bmp
gameOver.bmp
game_11_6.dsp
game_11_6.dsw
game_11_6.ncb
game_11_6.opt
game_11_6.plg
ground11.bmp
ground12.bmp
ground13.bmp
ground14.bmp
main.cpp
score0.bmp
score1.bmp
score2.bmp
score3.bmp
score4.bmp
score5.bmp
score6.bmp
score7.bmp
score8.bmp
score9.bmp
main.dsp
main.ncb
main.plg
main.opt
main.dsw
Debug/a1.bmp
Debug/back.bmp
Debug/boll.bmp
Debug/Debug.zip
Debug/die.bmp
Debug/gameOver.bmp
Debug/game_11_6.bsc
Debug/game_11_6.exe
Debug/game_11_6.ilk
Debug/game_11_6.pch
Debug/game_11_6.pdb
Debug/ground11.bmp
Debug/ground12.bmp
Debug/ground13.bmp
Debug/ground14.bmp
Debug/main.sbr
Debug/score0.bmp
Debug/score1.bmp
Debug/score2.bmp
Debug/score3.bmp
Debug/score4.bmp
Debug/score5.bmp
Debug/score6.bmp
Debug/score7.bmp
Debug/score8.bmp
Debug/score9.bmp
Debug/vc60.idb
Debug/vc60.pdb