- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
SPECEFFE.CPP
资源名称:泡泡龙源代码.zip [点击查看]
上传用户:junwei_58
上传日期:2007-05-15
资源大小:79k
文件大小:2k
源码类别:
其他智力游戏
开发平台:
Visual C++
- #define SPECEFFECT_CPP
- #include <dos.h>
- #include <stdlib.h>
- #include "game.h"
- #include "bubble.h"
- #include "speceffe.h"
- void ready_GO(){
- //message("Ready");
- for(int j=0;j<5;j++){
- if(soundON)sound((31+j)*20);
- delay(100);
- }
- //message("Ready",1);
- nosound();
- //message("GO");
- delay(100);
- //message("GO",1);
- }
- void beep(){
- if(soundON){
- sound(500);delay(20);sound(440);delay(10);
- sound(320);delay(10);nosound();
- }
- }
- void smoothout(){
- SvgaDAC pal[256],tpal[256];
- getpalette(0,256,pal);
- for(int i=60;i;i--){
- delay(10);
- for(int j=0;j<256;j++){
- tpal[j].red=i*pal[j].red/60;
- tpal[j].green=i*pal[j].green/60;
- tpal[j].blue=i*pal[j].blue/60;
- }
- setpalette(0,256,tpal);
- }
- clrScr(BKGROUNDCOLOR);
- setpalette(0,256,pal);//*/
- }
- void setPalette(){
- int c,p=159,per=54;
- SvgaDAC pal[256];
- getpalette(0,256,pal);
- pal[1].red=0; pal[1].green=0; pal[1].blue=255;
- pal[4].red=150; pal[4].green=0; pal[4].blue=0;
- pal[10].red=0; pal[10].green=255; pal[10].blue=0;
- pal[13].red=255; pal[13].green=100; pal[13].blue=50;
- pal[14].red=255; pal[14].green=255; pal[14].blue=0;
- pal[15].red=255; pal[15].green=255; pal[15].blue=255;
- for(c=159;c>9;c--){
- pal[p].red=per*pal[c/10].red/100;
- pal[p].green=per*pal[c/10].green/100;
- pal[p].blue=per*pal[c/10].blue/100;
- p--;
- per+=5;
- if(per>100)per=54;
- }
- pal[0].red=90;pal[0].green=100;pal[0].blue=100;//BKGROUNDCOLOR
- pal[1].red=0; pal[1].green=0; pal[1].blue=0; //ARROWCOLOR
- pal[2].red=10;pal[2].green=50; pal[2].blue=60; //BORDERCOLOR
- pal[3].red=50;pal[3].green=50; pal[3].blue=80; //TEXTCOLOR
- pal[4].red=250;pal[4].green=150;pal[4].blue=150; //TEXTCOLOR2
- setpalette(0,256,pal);
- }
- void PixelDance(){ // does a pixel dance! actually, randomly places a colored
- int r1, r2; // pixel here and there for a funky looking interface
- uchar c;
- for (int a = 0; a <= 50; a++ ){
- r1 = rand() % 800;
- r2 = rand() % 600;
- c=getpixel(r1, r2);
- if(c>=10&&c<160){
- c-=c%10;
- c+=rand()%10;
- setpixel( r1, r2, c );
- }
- }
- }