diff options
-rwxr-xr-x | CHANGELOG.TXT | 7 | ||||
-rwxr-xr-x | VERSION.TXT | 2 | ||||
-rw-r--r-- | global.h | 6 | ||||
-rw-r--r-- | levels.h | 114 | ||||
-rw-r--r-- | main.cpp | 207 | ||||
-rw-r--r-- | menus.h | 25 |
6 files changed, 249 insertions, 112 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index e5127bb..45d8cfa 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,18 +1,23 @@ =================================================================== Next version: -0.8.2-0_PR (b78) +0.9.x-x_PR (b??) Todo's: Complete the game system. Random segmentation fault in "Hyper-threading".(seen only once, can not reproduce now...) Pre-Released versions: +0.9.0-0_PR (b78) +First two assessment levels. +Finish assessment system framework. + 0.8.1-1_PR (b77) All parts from level -1 to 7 are completed! Fixed the crash in the mingw-w64 build. Complete GUI bring back. Fix a bug appeared after the cross-plantform port(when forked from BLRI). +Prepare for assessment mode. 0.8.1-0_PR (b76) New level "Sink over the horizon". diff --git a/VERSION.TXT b/VERSION.TXT index 82bd847..e56652f 100755 --- a/VERSION.TXT +++ b/VERSION.TXT @@ -1 +1 @@ -0.8.1-1_PR (b77)
\ No newline at end of file +0.9.0-0_PR (b78)
\ No newline at end of file @@ -6,7 +6,6 @@ #include <hgegui.h> #define MaxRes 80 #define Resd 20.0f -#define BLRVERSION "0.8.1-0_PR (b76)" HGE *hge=0; HEFFECT snd; hgeQuad quad; @@ -134,7 +133,7 @@ struct Tower bool exist,effect; double offset; DWORD RendColor; -}tower[100]; +}tower[250]; //t3t is for Tower3 //0:All 12 directions //1:four default directions @@ -256,7 +255,7 @@ hgeTTFont rbPanelFont; int frameleft,infofade; int level,part,clrtime,clrbns; int coll,semicoll,mode,dsmc,restarts; -double clrrange,clrrad,clrmaxrange,clrind; +double clrrange,clrrad,clrmaxrange,clrind,assetime; hgeSprite *clrcircle; bool Dis8ref,t8special; int frameskips=0,stepskips=0; @@ -290,6 +289,7 @@ fFristStartUp,fFast; int startLvl,startPrt,fFullScreen; char alterLog[64]; //static const char* GLOBAL_H_FN="global.h"; +static const char* BLRVERSION="0.9.0-0_PR (b78)"; void Throw(char *Filename,char *Info) { @@ -2985,7 +2985,7 @@ void Levelm1Part0() Current_Position=2; ShowTip("\ Level -1-Over the Horizon\n\ -?\ +Level -1! Getting ready?\ "); frameleft=TenSeconds;++part; } @@ -3508,3 +3508,115 @@ void Levelm1Part21() return; } } +void Levelm2Part0() +{ + frameleft=50;All2pnt();towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("\ +Level -2-Assessments\n\ +Welcome to assessment mode!\n\ +You won't step to the next level until\n\ +you have a collision.\n\ +Good luck and go for the highest score!\ +"); + IfCallLevel=false; + } + if (Current_Position==1) + { + frameleft=0;bulcnt=0;BTarg.TargHide(); + return; + } +} +Tower* dbtows[200]; +double dbroll[10]; +void Levelm2Part1() +{ + frameleft=Infinity;tbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 1 - Directed bullet"); + return; + } + for(int i=0;i<5;++i) + { + dbroll[i]=-i*120-20; + for(int j=0;j<20;++j) + dbtows[i*20+j]=&tower[CreateTower1(j*40+10,dbroll[i],4000,4)]; + } + ++part;assetime=0; +} +void Levelm2Part2() +{ + frameleft=Infinity;assetime+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + for(int i=0;i<5;++i) + { + dbroll[i]+=0.05*(1000.0f/hge->Timer_GetFPS()); + if(dbroll[i]>600)dbroll[i]=-20; + for(int j=0;j<20;++j) + { + dbtows[i*20+j]->towerpos=vector2d(j*40+10,dbroll[i]); + if(tbrk>0.033&&dbtows[i*20+j]->towertimer>2000)dbtows[i*20+j]->towertimer-=2; + } + } + if(tbrk>0.033)tbrk=0; +} +void Levelm2Part3() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 2 - Random bullets"); + All2pnt(); + return; + } + if (towcnt!=1&&towcnt!=0)return ClearAll(false); + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + CreateTower2(400,300,999999999,0); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part;assetime=tbrk=0; + return; + } +} +int rcnt; +void Levelm2Part4() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + assetime+=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=0.5; + if(assetime>=5)tbrk=re.NextDouble(0.25,0.5); + if(assetime>=10)tbrk=re.NextDouble(0.1,0.2); + if(assetime>=20)tbrk=re.NextDouble(0.05,0.08); + if(assetime>=30)tbrk=re.NextDouble(0.02,0.035); + if(assetime>=60)tbrk=0.02; + if(assetime<75)rcnt=1;if(assetime>=75)rcnt=2; + if(assetime>=120)rcnt=4;if(assetime>=150)rcnt=8; + double rspeed=re.NextDouble(0.5+3*assetime/180.0f,1+5*assetime/180.0f); + for(int i=0;i<rcnt;++i) + CreateBullet2(400,300,rspeed,re.NextDouble(-pi,pi)); + } +} @@ -228,119 +228,122 @@ void ProcessPlayer() if ((playerpos.y<570&&!PlayerSplit)||(playerpos.y<270&&PlayerSplit)) playerpos.y+=realspd; } - if (!clrmode) + if(mode!=2) { - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrange==0&&!diffkey) + if (!clrmode) { - clrmaxrange=0;clrind=0; - } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrange==0&&diffkey) - { - clrmaxrange=0;clrind=0; - } - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0&&!diffkey) - { - if (clrmaxrange<=400) + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrange==0&&!diffkey) { - if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + clrmaxrange=0;clrind=0; } - if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); - } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0&&diffkey) - { - if (clrmaxrange<=400) + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrange==0&&diffkey) { - if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + clrmaxrange=0;clrind=0; } - if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); - } - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrange==0&&!diffkey) - { - if (clrmaxrange<=50) + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0&&!diffkey) { - if (clrtime+clrbns){--clrtime;clrmaxrange=350;Player_Clear_Expand();++clrusg;} + if (clrmaxrange<=400) + { + if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + } + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); } - else + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0&&diffkey) { - Player_Clear_Expand();++clrusg; + if (clrmaxrange<=400) + { + if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + } + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); } - } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrange==0&&diffkey) - { - if (clrmaxrange<=50) + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrange==0&&!diffkey) { - if (clrtime+clrbns){--clrtime;clrmaxrange=350;Player_Clear_Expand();++clrusg;} + if (clrmaxrange<=50) + { + if (clrtime+clrbns){--clrtime;clrmaxrange=350;Player_Clear_Expand();++clrusg;} + } + else + { + Player_Clear_Expand();++clrusg; + } } - else + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrange==0&&diffkey) { - Player_Clear_Expand();++clrusg; + if (clrmaxrange<=50) + { + if (clrtime+clrbns){--clrtime;clrmaxrange=350;Player_Clear_Expand();++clrusg;} + } + else + { + Player_Clear_Expand();++clrusg; + } } - } - if (clrrange!=0) - { - Player_Clear_Expand(); - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); - clrind+=(LOWFPS?0.016*pi:0.001*pi); - } - if (clrrange>=clrmaxrange)clrrange=0; - } - else - { - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrad-pi/2<1e-7&&!diffkey) - { - clrmaxrange=0;clrind=0; - } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrad-pi/2<1e-7&&diffkey) - { - clrmaxrange=0;clrind=0; - } - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0&&!diffkey) - { - if (clrmaxrange<=400) + if (clrrange!=0) { - if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + Player_Clear_Expand(); + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); + clrind+=(LOWFPS?0.016*pi:0.001*pi); } - if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); + if (clrrange>=clrmaxrange)clrrange=0; } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0&&diffkey) + else { - if (clrmaxrange<=400) + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrad-pi/2<1e-7&&!diffkey) { - if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + clrmaxrange=0;clrind=0; } - if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); - } - if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrad-pi/2<1e-7&&clrtime+clrbns&&!diffkey) - { - Player_Clear_Rotate();if(clrmaxrange<50)--clrtime,clrmaxrange=350;++clrusg; - } - if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrad-pi/2<1e-7&&clrtime+clrbns&&diffkey) - { - Player_Clear_Rotate();if(clrmaxrange<50)--clrtime,clrmaxrange=350;++clrusg; - } - if (clrrad-pi/2>1e-7) - { - Player_Clear_Rotate(); - clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); - if(PlayerSplit)for(int i=1;i<4;++i) - clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); - clrind+=(LOWFPS?0.016*pi:0.001*pi); + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrad-pi/2<1e-7&&diffkey) + { + clrmaxrange=0;clrind=0; + } + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0&&!diffkey) + { + if (clrmaxrange<=400) + { + if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + } + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); + } + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0&&diffkey) + { + if (clrmaxrange<=400) + { + if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1; + } + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); + } + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrad-pi/2<1e-7&&clrtime+clrbns&&!diffkey) + { + Player_Clear_Rotate();if(clrmaxrange<50)--clrtime,clrmaxrange=350;++clrusg; + } + if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrad-pi/2<1e-7&&clrtime+clrbns&&diffkey) + { + Player_Clear_Rotate();if(clrmaxrange<50)--clrtime,clrmaxrange=350;++clrusg; + } + if (clrrad-pi/2>1e-7) + { + Player_Clear_Rotate(); + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); + clrind+=(LOWFPS?0.016*pi:0.001*pi); + } + if (5*pi/2-clrrad<1e-7)clrrad=pi/2; } - if (5*pi/2-clrrad<1e-7)clrrad=pi/2; } } void RefreshScore() @@ -363,6 +366,7 @@ void CallLevels() { //Use this to call level procedures. if ((mode==1)&&coll!=0){DeathGUI_Init();return;} + if ((mode==2)&&coll!=0){++part;coll=0;IfCallLevel=IfShowTip=true;return;} if (!IfCallLevel) return; //Check Complete here if (level==1&&part==0)Level1Part0(); @@ -517,6 +521,12 @@ void CallLevels() if (level==-1&&part==19)Levelm1Part19(); if (level==-1&&part==20)Levelm1Part20(); if (level==-1&&part==21)Levelm1Part21(); + if (level==-2&&part==0)Levelm2Part0(); + if (level==-2&&part==1)Levelm2Part1(); + if (level==-2&&part==2)Levelm2Part2(); + if (level==-2&&part==3)Levelm2Part3(); + if (level==-2&&part==4)Levelm2Part4(); + if (level==1&&part==5)level=2,part=0; if (level==2&&part==10) { @@ -770,11 +780,20 @@ bool FrameFunc() fnt->printf(5, 50, HGETEXT_LEFT, "Level %d",level); if (mode==3) fnt->printf(5, 75, HGETEXT_LEFT, "Collisions: %d",coll); + else if (mode==2) + fnt->printf(5, 75, HGETEXT_LEFT, "Elapsed Time: %.2lf",assetime); else fnt->printf(5, 75, HGETEXT_LEFT, "Restarts: %d",restarts); fnt->printf(5, 100, HGETEXT_LEFT, "Semi-Collisions: %d",semicoll); - fnt->printf(5, 125, HGETEXT_LEFT, "Clear Range Left: %d",clrtime+clrbns); - fnt->printf(5, 150, HGETEXT_LEFT, "Multiplier: %.2lf",mult); + if(mode==2) + { + fnt->printf(5, 125, HGETEXT_LEFT, "Multiplier: %.2lf",mult); + } + else + { + fnt->printf(5, 125, HGETEXT_LEFT, "Clear Range Left: %d",clrtime+clrbns); + fnt->printf(5, 150, HGETEXT_LEFT, "Multiplier: %.2lf",mult); + } } hge->Gfx_EndScene(); return false; @@ -76,21 +76,22 @@ void StartGUI_FrameFnk() IfCallLevel=true; break;*/ case 3: - /*playerpos.x=400,playerpos.y=400,playerrot=0; - frameleft=ThirtySeconds; - level=3,part=1;frms=0,averfps=0.0;restarts=0;bsscale=1.5; - towcnt=4;bulcnt=0; - clrrad=pi/2;clrrange=0; + playerpos.x=400,playerpos.y=400,playerrot=0; + frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false; + level=-2,part=0;frms=0,averfps=0.0;bsscale=1; + towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false; + score=0;Mult_Init();//Music_Init("./Resources/Music/CanonTechno.ogg"); + lpst=4625568;lped=9234584;//Music_Play(); + coll=semicoll=clrusg=0;playerLockX=playerLockY=false; + Lock.Init(2);IfShowTip=true;lsc=0; + //Lock.SetTexture(SprSheet,151,264,2,8); + clrrad=pi/2;clrrange=0;re.SetSeed(time(NULL)); memset(tower,0,sizeof(tower)); memset(bullet,0,sizeof(bullet)); - mode=2; - score=0; - coll=semicoll=clrusg=0; - IfShowTip=true; Complete=false; - Refliction=false; - Level3Part0(); - IfCallLevel=true;*/ + Current_Position=1; + IfCallLevel=true; + mode=2; break; case 4: playerpos.x=400,playerpos.y=400,playerrot=0; |