T060061 Wii Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition ++ ++ Paint.net ++ 1
2009 T060061 2
1 4 2 4 2.1 Visual C++ 2008 Express Edition.......................... 4 2.2..................................... 4 2.3................................ 5 3 6 3.1..................................... 6 3.2................................. 7 3.3....................................... 7 3.4......................................... 8 4 10 4.1.................................. 10 4.2.................................... 12 4.3..................................... 12 4.4...................................... 13 4.5............................... 14 5 16 6 18 6.1..................................... 18 6.2...................................... 20 7 21 8 22 9 23 3
1 2 Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition DirectX Windows DirectX Windows 2.1 Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition Microsoft Visual Studio Express Edition Visual C++ 2008 Web ( ) Visual C++ 2008 Express Edition 2.2 Visual C++ 2008 Express Edition 4
2.3 Visual C++ 2008 Express Edition 1 Win32 Win32 2 C++ cpp 3 C/C++ (/MTd) 4 Debug Release (/MT) 1: 2: Win32 3: 4: Release 5
3 if for C #include DxLib.h #include <math.h> int WINAPI WinMain(){ #include DxLib.h C #include<stdio.h> DX int WINAPI WinMain() int main(void) #include <math.h> C 1sin cos ChangeWindowMode(); () TRUE () FALSE ChangeWindowMode(); 3.1 char Key[256]; GetHitKeyStateAll(Key); 6
Z Z Z Z if(key[ KEY INPUT Z]==1) 3.2 GetColor(255,255,255) 0 255 0 GetColor(255,255,255) GetColor(255,0,0) GetColor(0,0,128) GetColor(255,255,0) GetColor(0,0,0) DX 2 24 1600 3.3 printf( ); (1)DrawString(100, 100,,GetColor(255,255,255)); (2)DrawFormatString(100,150,GetColor(255,0,0), Sum=% d,sum); (0,0) (640,480) (1) x,y GetColor(255,255,255) (100,100) (2) % d (1) (100,150) Sum 7
int Moji; Moji=CreateFontToHandle( HGS, 48, 1, DX FONTTYPE NORMAL); // (1) DrawStringToHandle(100,100,,GetColor(255, 255, 255),Moji); // (2A) DrawFormatStringToHandle(100,150,GetColor(255, 0, 0),Moji, % d,sum); // (2B) int (1) (1) HGS, HGS Moji (2A) (2B), HGS 3.4 int Picture1; Picture1=LoadGraph( Pic1.png ); // (1) DrawGraph(100, 100, Pic1, FALSE); // (2) int Picture1 (1) Pic1.png (2) (100,100) Pic1.png 5 5 int Picture2[100]; LoadDivGraph( Pic2.png, 16, 4, 4, 20, 20, Picture2); // (3) DrawGraph(100, 200, Picture2[0], FALSE); // (4) 5 Picture2[100] (3) Pic2.png Picture2[100] (2) Picture2 Pic2.png (4) (100,200) Pic2.png 8
double PI=3.14; DrawRotaGraph(100, 300, 2.0f, PI/2,Picture2[0],TRUE ); (100,300) 5 /2 2.0f double PI 5: Pic2.png 9
4 6 Game Start SPACE RETURN 6: 4.1 while 6 void GameStart(void) { while(1){ GetHitKeyStateAll( Key ) ; if( ProcessMessage() == -1 ) break ; 10
DrawGraph(0, 0, Open, FALSE); DrawStringToHandle( 100, 80,, GetColor(255, 255, 0), FontHG48); DrawBox(195, 250+25*start select, 510, 275+25*start select, GetColor(255, 255, 0), FALSE); DrawStringToHandle( 250, 250, PUSH RETURN, GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 252, teki0[0], TRUE); DrawFormatStringToHandle(250, 275, GetColor(255, 255, 255), FontHGS24, Time : %d,time1); DrawGraph(200, 277, Apple[0], TRUE); DrawStringToHandle( 250, 300, :, GetColor(255, 255, 255), FontHGS24); DrawFormatStringToHandle(360, 300,Lv color, FontHGS24, %s,lv1); DrawGraph(200, 302, Apple[13], TRUE); while(1){ break; break RETURN if( ProcessMessage() == -1 ) break; break; while(1) DrawBox(195, 250+25*start select, 510, 275+25*start select, GetColor(255, 255, 0), FALSE); GetColor(255, 255, 0) 195, 250+25*start select 510, 275+25*start select start select y Time 11
4.2 if(start counter<10) start counter++; else if(key[ KEY INPUT DOWN ] == 1 ){ start counter=0; start select++; if(start select>3) start select=1; else if(key[ KEY INPUT UP ] == 1 ){ start counter=0; start select ; if(start select<1) start select=3; start counter++; start select -1 start select +1 4.3 Time if(time counter<10) time counter++; else if(start select==1 && Key[ KEY INPUT RIGHT ] == 1 ){ time counter=0; time select++; 12
if(time select>7) time select=7; else if(start select==1 && Key[ KEY INPUT LEFT ] == 1 ){ time counter=0; time select ; if(time select<1) time select=1; if(time select==0) time1=10; else if(time select==1) time1=30; else if(time select==7) time1=600; time select 30 600 4.4 6 if(lv counter 10) Lv counter++; if(lv==1){ strcpy(lv1, Very Easy ); Lv color=getcolor(0, 255, 255); if(lv==2){ strcpy(lv1, Easy ); Lv color=getcolor(0, 255, 0); 13
Lv essy hard strcpy(lv1, very easy ); Lv1 very easy easy Lv color Lv 2 easy 4.5 7 7 7: // int Maxhp0[10]= {3, 2, 5, 2, ; int attack0[10]={3, 1, 5, 2, ; int speed0[10]= {3, 3, 1, 5, ; int count0[10]= {2, 5, 1, 3, ; int 7 void GameStart(void) 14
else if(start select==3){ DrawStringToHandle(110, 375,, GetColor(0, 200, 255), FontHGS20); DrawStringToHandle(110, 400,, GetColor(255, 0, 50), FontHGS20); DrawStringToHandle(110, 425,, GetColor(255, 255, 0), FontHGS20); DrawStringToHandle(110, 450,, GetColor(0, 255, 0), FontHGS20); for(i=0; i Maxhp0[character]; i++) DrawStringToHandle(200+20*i, 375,, GetColor(0, 200, 255), FontHGS20); for(j=0; j attack0[character]; j++) DrawStringToHandle(200+20*j, 400,, GetColor(255, 0, 50), FontHGS20); for(k=0; k speed0[character]; k++) DrawStringToHandle(200+20*k, 425,, GetColor(255, 255, 0), FontHGS20); for(m=0; m count0[character]; m++) DrawStringToHandle(200+20*m, 450,, GetColor(0, 255, 0), FontHGS20); DrawStringToHandle for int int character 15
5 void tama Input(void) { if(tama counter<5) // (1) tama counter++; else if(waza select==0 && Key[ KEY INPUT SPACE ] == 1 ){ // (2) tama counter=0; shot=tamamax; for(j=0; j<shot; j++){ if(tama[j].flag==0){ tama[j].flag=1; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=1; break; else if(waza select==1 && Key[ KEY INPUT SPACE ] == 1 ){ // (3) tama counter=5; shot=tamamax; tama Draw(); void tama Draw(void) { for(j=0; j<shot; j++){ if(tama[j].flag==1){ tama[j].y-=7; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); tama Hantei(); 16
void tama Input(void) (1) if if int tama counter (2) else if Waza select==0 SPACE (3) tama counter=5 (2) tama Draw(void) SPACE Waza select SPACE Waza select==0 Waza select==2 Waza select==3 tama Draw(void) DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); cut[0] 1.5f cut[0] 1.5 tama[j].x tama[j].y x y tama[j].y-=7 7 tama Hantei(); 17
6 8 8: 6.1 9 DX 9: 18
DrawStringToHandle( 505, 68, HP, GetColor( 255, 255, 0 ), FontHGS20) ; DrawFormatStringToHandle( 545, 80, GetColor( 255, 255, 255 ), FontHG20, % d, hp); DrawFormatStringToHandle( 575, 80, GetColor( 255, 255, 255 ), FontHG20, /% d, Maxhp) ; DrawBox(525, 70, 635, 80, GetColor(0, 0, 0), TRUE); if(hp<20) DrawBox(525, 70,525+110*hp/Maxhp, 80, GetColor(255, 0, 0), TRUE ); else if(hp<50) DrawBox(525, 70, 525+110*hp/Maxhp, 80, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 70, 525+110*hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); 9 HG int FontHG20 DrawStringToHandle DrawFormatStringToHandle DrawBox GetColor() TRUE DrawBox(525, 70, 525+110*hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); (525,70) (525+110*hp/Maxhp,80) 525+110*hp/Maxhp hp Maxhp hp 9 if DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); FALSE GetColor() 19
6.2 10 10 DrawBox(502, (Waza x+20)+waza select*20, 635, (Waza x+40)+waza select*20, GetColor(255, 255, 0), FALSE); if(waza counter<10) Waza counter++; else if(key[ KEY INPUT Z ] == 1 ){ Waza counter=0; Waza select++; if(waza select>3) Waza select=0; else if(key[ KEY INPUT X ] == 1 ){ Waza select=0; DrawStringToHandle(535, 370,, GetColor(255, 255, 0), FontHG20) ; DrawGraph(505,390, Waza1[0], TRUE); for(a=1; a<wazax; a++){ DrawGraph(505,390+20*a, Waza1[a], TRUE); DrawBox(530, 395+20*a, 630, 405+20*a, GetColor(0, 0, 0), TRUE); DrawBox(530, 395+20*a, 530+100*Waza[a]/MaxWaza[a], 405+20*a, GetColor(255, 0, 255), TRUE ); DrawBox(530, 395+20*a, 630, 405+20*a, GetColor(255, 255, 255), FALSE); 10: 8 Z,X Z 20
C 1 10 10 for for for for 7 21
8 [1] http://dixq.net/ [2] http://homepage2.nifty.com/natupaji/dxlib/ [3] Microsoft Visual Studio 2008 Express Edition http://www.microsoft.com/japan/msdn/vstudio/express/ [4] http://homepage2.nifty.com/yoshi-m/makehp/other/font.htm [5] http://www.math.ryukoku.ac.jp/ qma/education/cpro/index.html 22
9 #include "DxLib.h" #include <math.h> #define tamamax 500 #define StarMAX 30 #define SparkMAX 800 #define tekimax 100 #define WazaX 4 #define charax 9 #define PI 3.14159265358979323846 // char Key[256]; struct shot{ double x, y, x2, y2; double angle, X, Y, Z; int color; int flag; int Size; int attack; int A,d; ; struct STAR{ int x, y; int flag; int apple; int hantei_x, hantei_y, range; int color; int Size; int hp, Maxhp; int mp1, mp2; int attack; int counter; int shot; int teki; ; struct TEKI{ double x, y; int i; 23
int flag; int Size; int attack; double angle; int counter, shot; int color; int hantei_x, hantei_y, range; ; struct SPARK{ int x, y, xflag; int flag; int Sx, Sy; int color; int i, star; int time; ; void StartData(void); void GameStart(void); void GameOver(void); void Fighter(void); void Star_Draw(void); void Star_Hantei(void); void teki_attack(void); void teki_draw(void); void teki_hantei(void); void CreateSpark(int m, int n); void MoveSpark(void); void tama_input(void); void tama_draw(void); void tama_hantei(void); void GameDate(void); struct shot tama[tamamax]; struct STAR Star[StarMAX]; struct TEKI teki[tekimax]; struct SPARK Spark[SparkMAX]; int tama_counter=50, Star_counter=20; int a, i, j, k, m, n; int x, y; int P, Q; 24
int shot, teki_shot; int hp, Maxhp; int attack, speed, count; int score=0, score1, hscore=0; int tekihp=1, tekimaxhp=1, tekihpflag=0; int food_count=0; double hantei_x, hantei_y, range1; double hantei_x, hantei_y, range2; int Haikei_X=-960; int teki_count=0; int RefreshTime; // 1 2 3 4 5 6 7 8 9 int Maxhp0[10]= {3, 3, 5, 2, 3, 2, 5, 4, 3; int attack0[10]={3, 1, 5, 1, 3, 4, 3, 2, 4; int speed0[10]= {3, 3, 1, 5, 4, 2, 2, 4, 2; int count0[10]= {3, 5, 1, 4, 2, 4, 2, 2, 3; int start_select=0, start_counter=0; int time, time1, time_select=2, time_counter=0; int Lv=3, Lv_select=2, Lv_counter=0, LvA=0, LvC=0, LvHP=0, LvS=0, Lv_color; int character=0, character_counter=0; char Lv1[10]; int end_select=0, end_counter=0; int Waza[WazaX], MaxWaza[WazaX]; int Waza_select=0, Waza_counter=0, Waza_x=370; int Haikei, Open, Data, end; int MAN[32]; int cut[10]; int Apple[32], Mp[5]; int teki0[10], teki1[10], teki2, teki3, teki4, teki5; int tekia; int Waza0, Waza1[10]; int Bom,Block,Allow; int FontHGS_Spark, FontHGS16, FontHGS20, FontHGS24, FontHG16, FontHG20, FontHG24, FontHG48; //--------------------------------------------------------- WinMain int WINAPI WinMain( HINSTANCE hinstance, HINSTANCE hprevinstance,lpstr lpcmdline, int ncmdshow ){ ChangeWindowMode( TRUE ); // 25
if( DxLib_Init() == -1 ) return -1; //DX SetMainWindowText( " " ) ; FontHGS_Spark=CreateFontToHandle("HGS ", 10, 1, DX_FONTTYPE_NORMAL); FontHGS20=CreateFontToHandle("HGS ", 16, 16, DX_FONTTYPE_NORMAL); FontHGS24=CreateFontToHandle("HGS ", 24, 6, DX_FONTTYPE_NORMAL); FontHG16=CreateFontToHandle("HG ", 16, 1, DX_FONTTYPE_NORMAL); FontHG20=CreateFontToHandle("HG ", 20, 1, DX_FONTTYPE_NORMAL); FontHG24=CreateFontToHandle("HG ", 24, 1, DX_FONTTYPE_NORMAL); FontHG48=CreateFontToHandle("HG ", 48, 1, DX_FONTTYPE_NORMAL); Open=LoadGraph("PicFile\\Open.png"); end=loadgraph("picfile\\end.png"); LoadDivGraph("PicFile\\man.png", 18, 2, 9, 16, 16, MAN); Haikei=LoadGraph("PicFile\\haikei.png"); Data=LoadGraph("PicFile\\data.png"); LoadDivGraph("PicFile\\Apple.png", 16, 4, 4, 20, 20, Apple); LoadDivGraph("PicFile\\mp.png", 4, 2, 2, 20, 20, Mp); LoadDivGraph("PicFile\\teki0.png", 6, 3, 2, 20, 17, teki0); LoadDivGraph("PicFile\\teki1.png", 2, 2, 1, 16, 16, teki1); teki2=loadgraph("picfile\\teki2.png"); teki3=loadgraph("picfile\\teki3.png"); teki4=loadgraph("picfile\\teki4.png"); teki5=loadgraph("picfile\\teki5.png"); Bom=LoadGraph("PicFile\\Bom.png"); Block=LoadGraph("PicFile\\Block.png"); Allow=LoadGraph("PicFile\\Allow.png"); LoadDivGraph("PicFile\\Waza.png", 4, 2, 2, 20, 20, Waza1); LoadDivGraph("PicFile\\cut.png", 2, 2, 1, 9, 9, cut); SetDrawScreen( DX_SCREEN_BACK ) ;// GameStart(); StartData(); while(1){ RefreshTime = GetNowCount(); ClearDrawScreen(); GetHitKeyStateAll( Key ) ; // // // 26
if( ProcessMessage() == -1 ) break ; // DrawGraph(500, 0, Data, FALSE); DrawGraph(0, Haikei_X, Haikei, FALSE); Haikei_X+=1; if(haikei_x>0) Haikei_X=-960; Fighter(); // MoveSpark(); Star_Draw(); // tama_input(); // GameDate(); //ESC if( Key[ KEY_INPUT_ESCAPE] == 1 ) { hp=0; GameOver(); ScreenFlip() ;// while(getnowcount() - RefreshTime < 11); DxLib_End() ;// return 0 ;// //--------------------------------------------------------- WinMain void StartData(void) { hp=maxhp; if(score1>hscore) hscore=score1; score=0; time=time1*60+60; // tekihp=1; tekimaxhp=1; tekihpflag=0; 27
food_count=0; teki_count=0; x=250; y=420; if(lv==4){ LvHP=1; LvA=1; if(lv==5){ LvHP=2; LvA=3; LvS=2; if(lv==6){; LvC=1; LvS=10; Maxhp=Maxhp0[character]*20+40; hp=maxhp; attack=attack0[character]; speed=speed0[character]+1; count=count0[character]-1; Haikei_X=-960; Waza_select=0; Waza_counter=0; for(i=1; i<wazax; i++){ MaxWaza[i]=1000; Waza[i]=MaxWaza[i]*0.3; for(i=0; i<tamamax; i++){ tama[i].y=450; tama[i].flag=0; for(i=0; i<tekimax; i++){ teki[i].flag=0; teki[i].y=0; 28
teki[i].counter=0; for(i=0; i<starmax; i++){ Star[i].flag=0; Star[i].y=0; for(i=0; i<sparkmax; i++){ Spark[i].flag=0; Spark[i].xflag=0; // void GameStart(void) { while(1){ GetHitKeyStateAll( Key ) ; // if( ProcessMessage() == -1 ) break ; // DrawGraph(0, 0, Open, FALSE); DrawStringToHandle( 100, 80, " ", GetColor(255, 255, 0), FontHG48); DrawBox(195, 250+25*start_select, 490, 275+25*start_select, GetColor(255, 255, 0), FALSE); DrawStringToHandle( 250, 250, "Game Start", GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 252, teki0[0], TRUE); DrawFormatStringToHandle(250, 275, GetColor(255, 255, 255), FontHGS24, "Time : %d",time1); DrawGraph(200, 277, Apple[0], TRUE); DrawStringToHandle( 250, 300, " : ", GetColor(255, 255, 255), FontHGS24); DrawFormatStringToHandle(360, 300,Lv_color, FontHG24, "%s ",Lv1); DrawGraph(200, 302, Apple[13], TRUE); DrawStringToHandle( 250, 325, " ", GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 327, teki4, TRUE); DrawGraph(430, 327, MAN[character*2], TRUE); if(start_counter<10) start_counter++; else if(key[ KEY_INPUT_DOWN ] == 1 ){ start_counter=0; 29
start_select++; if(start_select>3) start_select=3; else if(key[ KEY_INPUT_UP ] == 1 ){ start_counter=0; start_select--; if(start_select<0) start_select=0; if(time_counter<10) time_counter++; else if(start_select==1 && Key[ KEY_INPUT_RIGHT ] == 1 ){ time_counter=0; time_select++; if(time_select>7) time_select=7; else if(start_select==1 && Key[ KEY_INPUT_LEFT ] == 1 ){ time_counter=0; time_select--; if(time_select<1) time_select=1; if(time_select==0) time1=10; else if(time_select==1) time1=30; else if(time_select==2) time1=60; else if(time_select==3) time1=90; else if(time_select==4) time1=120; else if(time_select==5) time1=180; else if(time_select==6) time1=300; else if(time_select==7) time1=600; 30
if(lv_counter<10) Lv_counter++; else if(start_select==2 && Key[ KEY_INPUT_RIGHT ] == 1 ){ Lv_counter=0; Lv++; if(lv>6) Lv=6; else if(start_select==2 && Key[ KEY_INPUT_LEFT ] == 1 ){ Lv_counter=0; Lv--; if(lv<1) Lv=1; if(lv==1){ strcpy(lv1,"very Easy"); Lv_color=GetColor(0, 255, 255); if(lv==2){ strcpy(lv1,"easy"); Lv_color=GetColor(0, 255, 0); if(lv==3){ strcpy(lv1,"normal"); Lv_color=GetColor(255, 255, 0); if(lv==4){ strcpy(lv1,"hard"); Lv_color=GetColor(255, 128, 0); if(lv==5){ strcpy(lv1,"very Hard"); Lv_color=GetColor(255, 0, 0); if(lv==6){ strcpy(lv1,"high Speed"); Lv_color=GetColor(255, 100, 255); if(character_counter<10) character_counter++; else if(start_select==3 && Key[ KEY_INPUT_RIGHT ] == 1 ){ character_counter=0; 31
character++; if(character>charax-1) character=charax-1; else if(start_select==3 && Key[ KEY_INPUT_LEFT ] == 1 ){ character_counter=0; character--; if(character<0) character=0; DrawBox(105, 370, 535, 470, GetColor(0, 255, 0), FALSE); if(start_select==0) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==1) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==1) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==2) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==3) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==4) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==5) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==6) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==3){ DrawStringToHandle(110, 375, " ", GetColor(0, 200, 255), FontHGS20); DrawStringToHandle(110, 400, " ", GetColor(255, 0, 50), FontHGS20); DrawStringToHandle(110, 425, " ", GetColor(255, 255, 0), FontHGS20); DrawStringToHandle(110, 450, " ", GetColor(0, 255, 0), FontHGS20); for(i=0; i<maxhp0[character]; i++) DrawStringToHandle(200+20*i, 375, " ", GetColor(0, 200, 255), FontHGS20); for(j=0; j<attack0[character]; j++) DrawStringToHandle(200+20*j, 400, " ", GetColor(255, 0, 50), FontHGS20); for(k=0; k<speed0[character]; k++) DrawStringToHandle(200+20*k, 425, " ", GetColor(255, 255, 0), FontHGS20); for(m=0; m<count0[character]; m++) 32
DrawStringToHandle(200+20*m, 450, " ", GetColor(0, 255, 0), FontHGS20); ScreenFlip(); if(key[ KEY_INPUT_RETURN] == 1 (start_select==0 && Key[ KEY_INPUT_SPACE] == 1 )) break; // void GameOver(void) { int Gyou=150; while(1){ GetHitKeyStateAll( Key ) ; // if( ProcessMessage() == -1 ) break ; // DrawGraph(500, 0, Data, FALSE); DrawGraph(0, Haikei_X, Haikei, FALSE); if(hp<1) DrawStringToHandle( 80, 100, " ", GetColor(255, 0, 0), FontHG48); DrawFormatStringToHandle(100, Gyou, GetColor(0, 255, 255), FontHG24, "Score %d", score); DrawFormatStringToHandle(100, Gyou+25, GetColor(255, 50, 255), FontHG24, " %d", Lv*time1*5 + food_count*100); DrawFormatStringToHandle(120, Gyou+45, GetColor(255, 255, 255), FontHG20, " %d %d = %d", Lv, time1*5, Lv*time1*5) ; DrawFormatStringToHandle(120, Gyou+65, GetColor(255,255, 255), FontHG20, " %d 100 = %d", food_count, food_count*100); score1= score + Lv*time1*5 + food_count*100; DrawLine(100, Gyou+85, 400, Gyou+85, GetColor(255,255,255), FALSE); DrawFormatStringToHandle(100, Gyou+85, GetColor(255,255,0), FontHG24, " %d", score1); 33
DrawStringToHandle( 100, 300, " ", GetColor(255, 255, 255), FontHG24); DrawStringToHandle( 120, 325, " Yes", GetColor(255, 255, 255), FontHG24); DrawStringToHandle( 220, 325, " No", GetColor(255, 255, 255), FontHG24); DrawBox(120+100*end_select, 325, 200+100*end_select, 350, GetColor(255, 255, 0), FALSE); if(end_counter<10) end_counter++; else if(key[ KEY_INPUT_RIGHT ] == 1 ){ end_counter=0; end_select++; if(end_select>1) end_select=0; else if(key[ KEY_INPUT_LEFT ] == 1 ){ end_counter=0; end_select--; if(end_select<0) end_select=1; if(end_select==0 && Key[ KEY_INPUT_RETURN ] == 1 ){ StartData(); break; else if(end_select==1 && Key[ KEY_INPUT_RETURN ] == 1 ){ DxLib_End(); // exit( -1 ); // ScreenFlip(); // void Fighter(void) { // DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2], TRUE); // if( Key[ KEY_INPUT_RIGHT ] == 1 ) x+=speed; if(x>=468) x=468; if( Key[ KEY_INPUT_LEFT ] == 1 ) 34
x-=speed; if(x<=0) x=0; if( Key[ KEY_INPUT_DOWN ] == 1 ) y+=speed; if(y>448) y=448; if( Key[ KEY_INPUT_UP ] == 1 ) y-=speed; if(y<150) y=150; // void Star_Draw(void) { if(star_counter<30-25*lvc) Star_counter++; else{ Star_counter=0; for(i=0; i<starmax; i++){ if(star[i].flag==0){ Star[i].x=10*GetRand(47)+10; P=GetRand(1000); // if(p<100){ if(lv==1) Star[i].flag=0; else Star[i].flag=2; Star[i].hp=15; Star[i].Maxhp=Star[i].hp; else if(p<150){ if(lv==1 Lv==6) Star[i].flag=0; else Star[i].flag=3; Star[i].hp=5; Star[i].Maxhp=Star[i].hp; 35
// else if(p<200){ if(lv<3 Lv>5) Star[i].flag=0; else Star[i].flag=GetRand(5)+4; if(teki_count<1) teki_count++; else Star[i].flag=0; Star[i].x=30*(GetRand(8)+1); // if(star[i].flag==4) Star[i].hp=50+LvHP*5; else if(star[i].flag==5) Star[i].hp=60+LvHP*5; else if(star[i].flag==6) Star[i].hp=40+LvHP*5; else if(star[i].flag==7) Star[i].hp=55+LvHP*5; else if(star[i].flag==8) Star[i].hp=42+LvHP*5; else if(star[i].flag==9) Star[i].hp=50+LvHP*5; Star[i].Maxhp=Star[i].hp; // else if(p<350){ Star[i].flag=10; Star[i].apple=GetRand(15); else if(p<450){ Star[i].flag=11; Star[i].mp1=GetRand(29); if(star[i].mp1==0) Star[i].mp2=2; else if(star[i].mp1<5) Star[i].mp2=3; else if(star[i].mp1<15) Star[i].mp2=1; 36
else Star[i].mp2=0; else{ Star[i].flag=1; if(lv==6) Star[i].hp=2; else Star[i].hp=10; Star[i].Maxhp=Star[i].hp; Star[i].color=GetRand(5); break; for(i=0; i<starmax; i++){ // if(star[i].flag==1){ Star[i].Size=10; Star[i].y+=1+LvS; DrawGraph(Star[i].x, Star[i].y, teki0[star[i].color], TRUE); Star_Hantei(); else if(star[i].flag==2){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Bom, TRUE); Star_Hantei(); else if(star[i].flag==3){ Star[i].y+=5+LvS; Star[i].Size=5; DrawGraph(Star[i].x, Star[i].y, Allow, TRUE); Star_Hantei(); else if(star[i].flag==4){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; 37
else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki1[0], TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==5){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki1[1], TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==6){ if(star[i].y>50 && Star[i].hp>0) Star[i].y=50; else Star[i].y+=2; Star[i].Size=20; Star[i].x=x; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki2, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==7){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki3, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==8){ if(star[i].y>30 && Star[i].hp>0) Star[i].y=30; else Star[i].y+=1; 38
Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki4, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==9){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki5, TRUE); Star_Hantei(); teki_attack(); // else if(star[i].flag==10){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Apple[Star[i].apple], TRUE); Star_Hantei(); else if(star[i].flag==11){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Mp[Star[i].mp2], TRUE); Star_Hantei(); // void Star_Hantei(void) { if(star[i].y>480){ Star[i].x=10*GetRand(47)+10; Star[i].y=0; Star[i].flag=0; // 39
hantei_x=(x+8)-star[i].x; hantei_y=(y+8)-star[i].y; range1=16+star[i].size; if( hantei_x * hantei_x + hantei_y * hantei_y < range1 * range1){ if(star[i].flag==1){ hp-=10; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); else if(star[i].flag==2){ hp-=20; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); for(int k=0; k<10; k++){ CreateSpark(x+16, y+16); else if(star[i].flag==3){ hp-=10; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); else if(star[i].flag==10){ if(star[i].apple>9) hp+=10; else hp+=5; food_count++; else if(star[i].flag==11){ if(star[i].mp2==3){ for(a=1; a<wazax; a++) Waza[a]-=MaxWaza[a]*0.2; else if(star[i].mp2==2){ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.3; else if(star[i].mp2==1){ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.1; else{ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.05; 40
Star[i].y=490; Star[i].flag=0; if(hp>=maxhp) hp=maxhp; if(hp<=0){ hp=0; GameOver(); for(a=1; a<wazax; a++){ if(waza[a]>=maxwaza[a]) Waza[a]=MaxWaza[a]; if(waza[a]<1) Waza[a]=0; // void teki_attack(void) { if(teki[i].counter<30) teki[i].counter++; else if(star[i].flag==4){ teki[i].counter=10; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=1; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=4; teki[teki[i].i].attack=3+lva; teki[teki[i].i].angle=pi/3+(pi*getrand(30)/90); break; 41
else if(star[i].flag==5){ teki[i].counter=20; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=2; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=3; teki[teki[i].i].attack=2+lva*2; teki[teki[i].i].angle=pi/4+(pi*getrand(30)/90); break; else if(star[i].flag==6){ teki[i].counter=0; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=3; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=3; teki[teki[i].i].attack=3+lva; break; else if(star[i].flag==7){ teki[i].counter=25; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=4; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=4; teki[teki[i].i].attack=3+lva; teki[teki[i].i].color=255; teki[teki[i].i].angle=m*pi/6; m++; 42
break; else if(star[i].flag==8){ teki[i].counter=25+lva; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=5; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=2; teki[teki[i].i].attack=1; teki[teki[i].i].color=255; teki[teki[i].i].angle=pi/6+(pi*getrand(120)/180); break; else if(star[i].flag==9){ teki[i].counter=25+lva; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=6; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=2; teki[teki[i].i].attack=1; teki[teki[i].i].angle=pi/3+(pi*getrand(30)/90); break; teki_draw(); // void teki_draw(void) { for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ 43
if(teki[teki[i].i].flag==1){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*4; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*4; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,50,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==2){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*6; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*6; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(128,0,255),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==3){ teki[teki[i].i].y+=5; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(255,255,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==4){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*2; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*2; teki[teki[i].i].color-=3; if(teki[teki[i].i].color<0) teki[teki[i].i].color=0; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(255,teki[teki[i].i].color,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==5){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*2; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*2; teki[teki[i].i].color--; if(teki[teki[i].i].color<0) teki[teki[i].i].color=0; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,teki[teki[i].i].color,255),TRUE ); teki_hantei(); if(teki[teki[i].i].flag==6){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*7; 44
teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*7; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,0,0), TRUE ); teki_hantei(); // void teki_hantei(void) { if(teki[teki[i].i].x<0 teki[teki[i].i].x>490 teki[teki[i].i].y<0 teki[teki[i].i].y>500 Star[i].hp<1){ teki[teki[i].i].y=500; teki[teki[i].i].flag=0; teki[teki[i].i].hantei_x=(x+16)-teki[teki[i].i].x; teki[teki[i].i].hantei_y=(y+16)-teki[teki[i].i].y; teki[teki[i].i].range=16+teki[teki[i].i].size; if(teki[teki[i].i].hantei_x * teki[teki[i].i].hantei_x + teki[teki[i].i].hantei_y * teki[teki[i].i].hantei_y <= teki[teki[i].i].range * teki[teki[i].i].range){ hp-=teki[teki[i].i].attack; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); teki[teki[i].i].y=500; teki[teki[i].i].flag=0; if(hp<=0){ hp=0; GameOver(); // void tama_input(void) { if(tama_counter<25) tama_counter++; else if(waza_select==0 && Key[ KEY_INPUT_SPACE ] == 1 ){ 45
tama_counter=count*5; shot=tamamax; for(j=0; j<shot; j++){ if(tama[j].flag==0){ tama[j].flag=1; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=attack; break; else if(waza_select==1 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=count*5; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<20){ break; else if(tama[j].flag==0){ tama[j].flag=2; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=attack*2; Waza[Waza_select]-=20; break; else if(waza_select==2 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=25; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<2){ break; else if(tama[j].flag==0){ 46
tama[j].flag=3; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=5; tama[j].attack=1; tama[j].color=255; tama[j].angle=-(5*pi/12+(pi*getrand(30)/180)); tama[j].d=getrand(150)+50; Waza[Waza_select]-=2; break; else if(waza_select==3 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=25; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<2){ break; else if(tama[j].flag==0){ tama[j].flag=4; tama[j].x=x+16; tama[j].x2=x+16; tama[j].y=y+16; tama[j].y2=y+16; tama[j].size=2; tama[j].attack=5; tama[j].color=255; tama[j].angle=-n*pi/4; Waza[Waza_select]-=2; n++; break; tama_draw(); 47
// void tama_draw(void) { for(j=0; j<shot; j++){ if(tama[j].flag==1){ tama[j].y-=6; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); tama_hantei(); else if(tama[j].flag==2){ tama[j].y-=12; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[1], TRUE); tama_hantei(); else if(tama[j].flag==3){ tama[j].x+=cos(tama[j].angle)*3; tama[j].y+=sin(tama[j].angle)*3; tama[j].color-=12; if(tama[j].color<0) tama[j].color=0; DrawCircle( tama[j].x, tama[j].y, tama[j].size, GetColor(255,tama[j].color,0),TRUE ); tama_hantei(); else if(tama[j].flag==4){ tama[j].x+=cos(tama[j].angle)*3; tama[j].y+=sin(tama[j].angle)*3; tama[j].color-=5; if(tama[j].color<0) tama[j].color=0; DrawCircle( tama[j].x, tama[j].y, tama[j].size, GetColor(0,tama[j].color,255),TRUE ); tama_hantei(); // void tama_hantei(void) { for(i=0; i<starmax; i++){ Star[i].hantei_x=tama[j].x - (Star[i].x+Star[i].Size); Star[i].hantei_y=tama[j].y - (Star[i].y+Star[i].Size); Star[i].range=Star[i].Size + tama[j].size; 48
// if( (Star[i].hantei_x * Star[i].hantei_x + Star[i].hantei_y * Star[i].hantei_y <= Star[i].range * Star[i].range) && Star[i].flag<10){ Star[i].hp-=tama[j].attack; tekimaxhp=star[i].maxhp; tekihp=star[i].hp; tekihpflag=1; if(tekimaxhp<1) tekimaxhp=1; if(tekihp<0) tekihp=0; if(star[i].hp<=0){ if(star[i].flag==1){ score+=50; Spark[j].star=3; if(star[i].flag==2){ score+=100; Spark[j].star=5; if(star[i].flag==3){ score+=100; Spark[j].star=3; if(star[i].flag>3){ score+=300; teki_count--; Spark[j].star=5; for(spark[j].i=0; Spark[j].i<Spark[j].star; Spark[j].i++){ CreateSpark(tama[j].x, tama[j].y); tama[j].y=y; tama[j].flag=0; Star[i].y=490; 49
else{ tama[j].y=y; tama[j].flag=0; if( (tama[j].flag==1 && tama[j].y<tama[j].y2-150) (tama[j].flag==2 && tama[j].y<0) (tama[j].flag==3 && tama[j].y<tama[j].y2-tama[j].d) (tama[j].flag==4 && (tama[j].x<tama[j].x2-100 tama[j].x>tama[j].x2+100 tama[j].y<tama[j].y2-100 tama[j].y>tama[j].y2+100)) tama[j].x>500-tama[i].size){ tama[j].y=y; tama[j].flag=0; // void GameDate(void) { DrawLine(500,0,500,480,GetColor(255,255,255),FALSE); // time--; DrawFormatStringToHandle(510, 0, GetColor(255,255,255 ), FontHG20, "time %d", time/60); if(time/60<=0) GameOver(); // DrawFormatStringToHandle(510,30, GetColor(255,255,255 ), FontHG20, "Score %d", score); // DrawStringToHandle( 505, 68, "HP", GetColor( 255, 255, 0 ), FontHGS20) ; DrawFormatStringToHandle( 545, 80, GetColor( 255, 255, 255 ), FontHG20, "%d", hp); DrawFormatStringToHandle( 575, 80, GetColor( 255, 255, 255 ), FontHG20, "/%d", Maxhp) ; DrawBox(525, 70, 635, 80, GetColor(0, 0, 0), TRUE); if(hp<0.2*maxhp) DrawBox(525, 70,525+110*hp/Maxhp, 80, GetColor(255, 0, 0), TRUE ); else if(hp<0.5*maxhp) 50
DrawBox(525, 70, 525+110*hp/Maxhp, 80, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 70, 525+110*hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); // DrawGraph(502,105, teki0[0], TRUE); if(tekihpflag==1){ DrawFormatStringToHandle( 555, 120, GetColor( 255, 255, 255 ), FontHG20, "%d", tekihp); DrawFormatStringToHandle( 575, 120, GetColor( 255, 255, 255 ), FontHG20, "/%d", tekimaxhp); DrawBox(525, 110, 635, 120, GetColor(0, 0, 0), TRUE); if(tekihp<=tekimaxhp*0.2) DrawBox(525, 110,525+110*tekiHP/tekiMAXHP, 120, GetColor(255, 0, 0), TRUE ); else if(tekihp<=tekimaxhp*0.5) DrawBox(525, 110,525+110*tekiHP/tekiMAXHP, 120, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 110,525+110*tekiHP/tekiMAXHP, 120, GetColor(0, 128, 255), TRUE ); DrawBox(525, 110, 635, 120, GetColor(255, 255, 255), FALSE); DrawLine(500, 160, 640, 160, GetColor(255,255,255), FALSE); DrawStringToHandle( 525, 160, " ", GetColor( 255, 255, 0), FontHG20); DrawStringToHandle( 505, 185, " : ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 205, " :SPACE ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 225, " :Z,C ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 245, " :Esc ", GetColor( 255, 255, 255), FontHG16); DrawLine(500, 275, 640, 275, GetColor(255,255,255), FALSE); DrawStringToHandle( 525, 275, " ", GetColor( 255, 255, 0 ), FontHG20) ; DrawFormatStringToHandle( 510, 300, GetColor( 255, 255, 255 ), FontHG16, " %d", time1); DrawStringToHandle( 510, 320, "Lv", GetColor( 255, 255, 255), FontHG16) ; DrawFormatStringToHandle( 535, 320, Lv_color, FontHG16, "%s", Lv1); DrawFormatStringToHandle( 510, 340, GetColor( 255, 255, 255 ), FontHG16, "HighScore %d", hscore); DrawLine(500, Waza_x, 640, Waza_x, GetColor(255,255,255), FALSE); DrawBox(502, (Waza_x+20)+Waza_select*20, 635, (Waza_x+40)+Waza_select*20, GetColor(255, 255, 0) FALSE); if(waza_counter<10) Waza_counter++; 51
else if(key[ KEY_INPUT_Z ] == 1 ){ Waza_counter=0; Waza_select++; if(waza_select>3) Waza_select=0; else if(key[ KEY_INPUT_X ] == 1 ){ Waza_select=0; DrawStringToHandle( 535, Waza_x, " ", GetColor( 255, 255, 0 ), FontHG20) ; DrawGraph(505,Waza_x+20, Waza1[0], TRUE); for(a=1; a<wazax; a++){ DrawGraph(505,(Waza_x+20)+20*a, Waza1[a], TRUE); DrawBox(530, (Waza_x+25)+20*a, 630, (Waza_x+35)+20*a, GetColor(0, 0, 0), TRUE); DrawBox(530, (Waza_x+25)+20*a,530+100*Waza[a]/MaxWaza[a], (Waza_x+35)+20*a, GetColor(255, 0, 255), TRUE ); DrawBox(530, (Waza_x+25)+20*a, 630, (Waza_x+35)+20*a, GetColor(255, 255, 255), FALSE); // void CreateSpark(int m, int n) { for(k=0; k<sparkmax; k++){ if(spark[k].flag==0) break; if(k!= SparkMAX){ Spark[k].x=m*100; Spark[k].y=n*100; Spark[k].Sx=GetRand(600)-300; Spark[k].Sy=-GetRand(200); Spark[k].time=GetRand(150)+50; Spark[k].color=GetRand(4); if(spark[k].color==0) Spark[k].color=GetColor(255,255,0); else if(spark[k].color==1) Spark[k].color=GetColor(0,255,255); else if(spark[k].color==2) 52
Spark[k].color=GetColor(255,100,255); else if(spark[k].color==3) Spark[k].color=GetColor(255,150,0); else if(spark[k].color==4) Spark[k].color=GetColor(0,255,0); Spark[k].flag=1; // void MoveSpark(void) { for(k=0; k<sparkmax; k++){ if(spark[k].flag==0) continue; Spark[k].y+=Spark[k].Sy; if(spark[k].xflag==0) Spark[k].x+=Spark[k].Sx; else if(spark[k].xflag==1) Spark[k].x-=Spark[k].Sx; Spark[k].Sy+=3; Spark[k].time--; if(spark[k].time<0){ Spark[k].flag=0; Spark[k].xflag=0; if(spark[k].x<0 Spark[k].x/100>490) Spark[k].xflag=1; for(k=0; k<sparkmax; k++){ if(spark[k].flag==1){ DrawStringToHandle(Spark[k].x/100, Spark[k].y/100, " ", Spark[k].color, FontHGS_Spark); 53