资源简介
一个自己做的dos小游戏
代码片段和文件信息
#define HURT 1047
#define DHURT 784
#define closegr closegraph
#include “mouse.c“
#include “timer.c“
#include “start.c“
#include “hero.c“
#include “kaishi.c“
#include
#include “keyboard.c“
#include
#include
#include “Conio.h“
#include
#include
#include “mouse.h“
#define wide 20
#define legx 15
#define legy 15
#define legjumpx 15
#define legjumpy 5
#define jumphight 3
#define r 15
#define r2 10
#define arm 15
#define bodylength 25
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define ESC 0x011b
#define leglength 30
#define legwidth 10
#define bodylength2 40
#define bodywidth2 40
void *legbuf*bodybuf*legbuf2*jump*lowleg*handattack*legattack*jumpleg;
void *bodybuf2*walkbuf2*handattack2*jumpattack2*hit1*hit2;
void *defense1;
int blood1=250blood2=250blood_1=250blood_2=250TimeCounter=1800mark=0;
int ajump1=0jump2=0jumpup1=0jumpback1=0jumpup2=0jumpback2=0go=0;
int defensestate1=0flag=0;
int x=100y=300;
int x2=540y2=300;
void draw(int xint y) /*事先将要用的图像画出存在缓存里*/
{ int size;
setbkcolor(YELLOW); /*站立时的腿2*/
setcolor(RED);
setlinestyle(002);
moveto(xy);
linerel(-legx/2legy);
linerel(0legy);
moveto(xy);
linerel(legx/2legy);
linerel(0legy);
size=imagesize(x-legx-2yx+legx+2y+legy*2);
legbuf2=malloc(size);
getimage(x-legx-2yx+legx+2y+legy*2legbuf2);
cleardevice();
circle(xyr); /*跳起*/
moveto(xy+r);
linerel(0bodylength);
moveto(xy+r+10);
linerel(-arm-6);
linerel(-arm0);
moveto(xy+r+10);
linerel(arm4);
linerel(-arm3);
moveto(xy+r+bodylength);
linerel(-legjumpxlegjumpy);
linerel(legxlegjumpy);
moveto(xy+r+bodylength);
linerel(legjumpxlegjumpy);
linerel(-legxlegjumpy);
size=imagesize(x-arm*2-2y-r-jumphight-5x+legjumpxy+r+bodylength+2*legy+jumphight);
jump=malloc(size);
getimage(x-arm*2-2y-r-jumphight-5x+legjumpxy+r+bodylength+2*legy+jumphightjump);
cleardevice();
moveto(xy); /*蹲下的腿*/
linerel(1010);
linerel(-175);
moveto(xy);
linerel(150);
linerel(015);
size=imagesize(x-7yx+15y+15);
lowleg=malloc(size);
getimage(x-7yx+15y+15lowleg);
cleardevice();
/*防御*/
moveto(xy);
circle(xyr);
moveto(xy+r);
linerel(0bodylength+2*legy);
moveto(xy+r+10);
linerel(200);
linerel(0-20);
moveto(xy+bodylength+r);
linerel(200);
linerel(020);
size=imagesize(x-ry-rx+20y+r+bodylength+2*legy);
defense1=malloc(size);
getimage(x-ry-rx+20y+r+bodylength+2*legydefense1);
cleardevice();
/*用手攻击*/
moveto(xy);
circle(xyr);
moveto(xy+r);
linerel(0bodylength);
linerel(-3020);
moveto(xy+bodylength+r);
linerel(200);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 332 2008-06-03 01:24 start.c
文件 2400 2008-06-16 12:30 timer.c
文件 25643 2008-06-08 12:22 asd4.c
文件 4641 2008-06-08 12:21 hero.c
文件 18278 2008-06-16 12:51 kaishi.c
文件 2921 2008-05-24 00:41 keyboard.c
文件 1237 2008-06-03 00:42 mouse.c
文件 609 2007-06-19 23:06 mouse.h
文件 27535 2008-06-16 12:56 fighter.c
文件 27535 2008-06-16 15:16 projects\fighter.c
文件 53586 2008-06-16 15:16 projects\FIGHTER.EXE
文件 31171 2008-06-16 15:16 projects\FIGHTER.OBJ
文件 4641 2008-06-08 12:21 projects\hero.c
文件 18278 2008-06-16 12:51 projects\kaishi.c
文件 2921 2008-05-24 00:41 projects\keyboard.c
文件 1237 2008-06-03 00:42 projects\mouse.c
文件 609 2007-06-19 23:06 projects\mouse.h
文件 332 2008-06-03 01:24 projects\start.c
文件 2400 2008-06-16 12:30 projects\timer.c
目录 0 2008-06-16 15:16 projects
----------- --------- ---------- ----- ----
226306 20
评论
共有 条评论