1
2
3
4
1.1 PC 3D -- DirectX 5
1.2 RPG -- VC++ DirectX VC++ DirectX 360 : 6
7
8
9
2.2 10
11
12
13
2.3 14
RPG RPG Map_Struct Map[MAPS] MAPS Scene MakeBackGround() MakeBackGround Blt Blt Windows PatBltpattern block transfer PatBlt PatBlt hdc, x, y, c x, cy, dwrop; 15
x ycx cy xy cx cy PatBlt dwrop ROP ROP BitBltPatBltStretchBlt GDI BltLPDIRECTDRAWSURFACE SS, int x, int y, LPDIRECTDRAWSURFACE DS, RECT rcrect, BOOL Flog SSDS xy rcrect GetRect rcrect DrawNpc 16
void DrawNpc { for(int i=0; i<map[scene].npc_nums; i++) if( Map[Scene].NPC[i].Show == 1 ) // NPC { rect=getrect( ); Blt( ); } } ( ).NPC DrawNpc.NPC NPC NPC NPCMove NPC Way 3012 17
2.4 DirectDraw colorkey 18
NPC NPC IF if( Hero.x<0 ) Hero.x=0; if( Hero.x>ScreenX-Hero.Width ) Hero.x=ScreenX-Hero.Width; if( Hero.y<Hero.Hight-16 ) Hero.y=Hero.Hight-16; if( Hero.y>ScreenY ) Hero.y=ScreenY; 19
if( SX < 0 ) SX=0; if( SX > Map[ Scene ].Width - 20 ) SX=Map[ Scene ].Width -20; if( SY < 0 ) SY=0; if( SY > Map[ Scene ].Hight - 15 ) SY=Map[ Scene ].Hight -15; Hero.Stats++; if( Hero.Stats>=3 ) Hero.Stats=0; NPC Enter NPC 0x5000+ *32+ 0x5000+ *32+ 30 switch-case 20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
delay Di 50
VC++Windows DirectX Windows VC++ VC++ VC++ Windows MFCMicrosoft Foundation Classes Windows API C++ Windows DirectX GDI 51
52
4. DirectX 6.0 5. http://www.ccw.com.cn/htm/produ/special/vc/jiqiao/01_9_13_21.asp 6. Programming Windows Charles Petzold 6 / 2 / 2000 7. http://www.gpgame.com/download/rpg_source.zip 53