Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Back.h
Package: JAVA.rar [view]
Upload User: kf1822
Upload Date: 2021-06-02
Package Size: 2156k
Code Size: 3k
Category:
Games
Development Platform:
Java
- /* 图形驱动象素为640x350 */
- #include "graphics.h"
- #include <stdlib.h>
- void initErectNodeY(int y[],int n) /* 初始化所有竖节Y坐标 */
- {
- int i,size=32; /* 共有11节合成一个竖柱 */
- y[0]=0; /* 节与节之间有2个象素点的间隔 */
- for(i=1;i<n;i++) /* 每个节30长高度 共有10个间隔 */
- { /* 共20个象素点 加上11个节共330象素点 */
- y[i]=size*i; /* 刚好符合Y=350的屏幕规格 */
- }
- }
- void drawErectNode(int y,int x)/* 画竖节 */
- {
- setfillstyle(1,LIGHTBLUE);
- bar(x,y,x+19,y+29);
- }
- void drawDoor()
- {
- int i;
- int x;
- int y[11];
- initErectNodeY(y,11);
- for(i=0;i<11;i++) /* 左墙 */
- {
- x=59;
- drawErectNode(y[i],x);
- }
- for(i=0;i<11;i++) /* 右墙 */
- {
- x=419;
- drawErectNode(y[i],x);
- }
- }
- typedef struct star
- {
- int px;
- int py;
- int size;
- int color;
- }stars;
- void drawStar(stars s) /* 画星星 */
- {
- setfillstyle(1,s.color);
- setcolor(BLACK);
- fillellipse(s.px,s.py,s.size,s.size);
- }
- void initStars(stars s[],int n) /* 初始化星星 */
- {
- int i;
- for(i=0;i<n-25;i++)
- {
- s[i].px=rand()%53+3;
- s[i].py=rand()%350;
- s[i].size=rand()%2+1;
- s[i].color=rand()%15+1;
- }
- for(i=25;i<n;i++)
- {
- s[i].px=rand()%199+441;/* px>440 && px<640 */
- s[i].py=rand()%350;
- s[i].size=rand()%2+1;
- s[i].color=rand()%15+1;
- }
- }
- void drawAllStars(stars s[],int n) /* 画所有星星 形成星空 */
- {
- int i;
- for(i=0;i<n;i++)
- {
- drawStar(s[i]);
- }
- }
- typedef struct Thorn /* 刺的新类型 */
- {
- int xy[3][2];
- }Thorn;
- void initThorn(Thorn t[],int n)
- {
- int i;
- int j;
- int k;
- int tempX=79;
- int tempY=46;
- for(i=0;i<n;i++)
- {
- for(j=0;j<3;j++)
- {
- if(j==1)
- tempX=tempX+10;
- for(k=0;k<2;k++)
- {
- if(j==2)
- {
- if(k==0)
- t[i].xy[j][k]=tempX-5;
- else
- t[i].xy[j][k]=tempY+15;
- }
- else
- {
- if(k==0)
- t[i].xy[j][k]=tempX;
- else
- t[i].xy[j][k]=tempY;
- }
- }
- }
- }
- }
- void drawThorn(Thorn t[],int n)
- {
- int i;
- for(i=0;i<n;i++)
- {
- setfillstyle(1,RED);
- setcolor(WHITE);
- fillpoly(3,*(t+i)->xy);
- }
- }