快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

和记娱乐登录_机器人论坛



#include "graphics.h"

#include "bios.h"

#in和记娱乐登录clude "conio.h"

#include "stdlib.h"

#include "dos.h"

#define UP 0x4800

#define DOWN 0x5000

#define LEFT 0x4600

#define RIGHT 0x4d00

#define ESC 0x0016

#define VGA256 0x13

#define TEXT 0x03

int x,y,l,sxzy=0,zx=0,xx=5,yy=167;

int x1=5,y1=3,x3=0,y3=0,x4=0,y4=0;

int youlife=50,mylife=30;

int board[100][170];

unsigned char far *video_buff=(char far *)0xA0000000L;

void setvideomode(int mode)

{ union REGS inregs,outregs;

inregs.h.ah=0;

inregs.h.al=(unsigned char)mode;

int86(0x10,&inregs,&outregs);

}

void v_line(int y0,int y1,int x,unsigned int color)

{ unsigned int address,n,temp;

address=320*y0+x;

for(n=0;ny1)

{

temp=y1;

y1=y0;

y0=temp;

}

video_buff[address]=color;

address+=320;

}

}

void h_line(int x0,int x1,int y,unsigned int color)

{ unsigned int address,n,temp;

address=320*y+x0;

for(n=0;nx1)

{

temp=x1;

x1=x0;

x0=temp;

}

video_buff[address]=color;

address+=1;

}

}

void p_pixel(int x,int y,unsigned int color)

{ video_buff[y*320+x]=color;

}

void s_square(int x,int和记娱乐登录 y,int side,int color)

{

h_line(x,x+side,y,和记娱乐登录color);

h_line(x,x+side,y+side,color);

v_line(y,y+side,x,color);

v_line(y,y+side,x+side,color);

}

void r_rectangle(int x1,i和记娱乐登录nt y1,和记娱乐登录int x2,int y2,int color)

{

h_line(x1,x2,y1,color);

h_line(x1,x2,y2,color);

v_line(y1,y2,x1,color);

v_line(y1,y2,x2,color);

}

void fillRectangle(int x1,int y1,int x2,int y2,int color)

{

int i;

for(i=y1;i=x1 && xx=x1))

youlife--;

cas=2;

zx=0;

}

&nb

相关涉猎:

数据布局在游戏中的简单利用

简单打飞碟游戏

简单图形模拟吃豆游戏

24点扑克牌游戏

您可能还会对下面的文章感兴趣: