⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 worm2.cpp

📁 一个小游戏
💻 CPP
字号:
//Worm2.cpp

#include <conio.h>
#include <dos.h>
#include "worm2.h"

void main(void)
{
int gdriver=VGA,gmode=VGAHI;
int i,flag=0;
float back;
/*在此之前请先在DOS窗口中键入:
	你的BC或TC++的路径\bgi\bgiobj egavga
	你的BC或TC++的路径\bin\tlib ..\lib\graphics.lib+..\bgi\egavga.obj
  这样就可把图形驱动程序egavga.bgi连接到应用程序中,使程序可以独立运行。
*/	
registerbgidriver(EGAVGA_driver);
initgraph(&gdriver,&gmode,"");
setbkcolor(BACKCOLOR);
worm *head,*p1,*p2;
head=new worm(random(640),random(480),(float)random(3000),
			(float)random(38),(float)random(38));
p1=p2=head;
head->pre=NULL;
for(i=1;i<=BEGIN;i++)
{
p2->next=new worm(random(640),random(480),(float)random(3000),
			(float)random(38),(float)random(38));
p2=p2->next;
p2->pre=p1;
p1=p2;
}
p1->next=head;
head->pre=p1;
setcolor(2);
for(i=0;i<=500;i++)
	outtextxy(random(640),random(480),"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -