aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-26 03:35:14 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-26 03:35:14 +0000
commitbd9f7d7edf3775f644003887dfa195e9a8b9f54a (patch)
tree534f44926eb5595f2ed6898ff0dba755d743d72c
parente33464c9892a8dc26cb0ea2a6e6c3e3585a1f518 (diff)
downloadbullet-lab-remix-bd9f7d7edf3775f644003887dfa195e9a8b9f54a.tar.xz
One more level, fix compile error...
-rwxr-xr-xCHANGELOG.TXT1
-rw-r--r--levels.h80
-rw-r--r--main.cpp5
-rw-r--r--menus.h2
-rw-r--r--towernbullet.h41
5 files changed, 106 insertions, 23 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index aa33000..15f7ab4 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -10,6 +10,7 @@ Pre-Released versions:
0.9.0-0_PR (b78)
First two assessment levels.
Two more assessment levels...
+One more assessment level......
Finish assessment system framework.
Add circ2pnt.
diff --git a/levels.h b/levels.h
index 8bebf7d..08de304 100644
--- a/levels.h
+++ b/levels.h
@@ -3531,7 +3531,7 @@ Good luck and go for the highest score!\
}
if (Current_Position==1)
{
- frameleft=0;bulcnt=0;BTarg.TargHide();
+ frameleft=0;bulcnt=0;
return;
}
}
@@ -3555,11 +3555,11 @@ void Levelm2Part1()
for(int j=0;j<20;++j)
dbtows[i*20+j]=&tower[CreateTower1(j*40+10,dbroll[i],4000,4)];
}
- ++part;assetime=0;
+ ++part;
}
void Levelm2Part2()
{
- frameleft=Infinity;assetime+=hge->Timer_GetDelta();
+ frameleft=Infinity;
tbrk+=hge->Timer_GetDelta();
for(int i=0;i<5;++i)
{
@@ -3607,7 +3607,6 @@ void Levelm2Part4()
{
frameleft=Infinity;
tbrk-=hge->Timer_GetDelta();
- assetime+=hge->Timer_GetDelta();
if(tbrk<0)
{
tbrk=0.5;
@@ -3623,7 +3622,8 @@ void Levelm2Part4()
CreateBullet2(400,300,rspeed,re.NextDouble(-pi,pi));
}
}
-BCircle asscircles[200];
+
+expSpinner es;
void Levelm2Part5()
{
frameleft=Infinity;
@@ -3633,30 +3633,66 @@ void Levelm2Part5()
IfShowTip=false;
FadeTip=false;
Current_Position=2;
- ShowTip("Test 4 - Crossing 1");
+ ShowTip("Test 3 - Constant patterns");
All2pnt();
return;
}
if (towcnt!=0)return ClearAll(false);
if(Current_Position==1)
{
- assetime=0;memset(asscircles,0,sizeof(asscircles));
++part;avabrk=0;avacurbrk=0;
}
}
void Levelm2Part6()
{
+ avacurbrk+=hge->Timer_GetDelta();
+ if(avacurbrk>avabrk)
+ {
+ avacurbrk=0;
+ avabrk=6-2*assetime/120.0f;
+ if(avabrk<3)avabrk=1;
+ es.Init(3+5*assetime/120.0f,10,re.NextInt(-pi,pi));
+ }
+ if(es.isActive())es.Update();
+}
+
+BCircle asscircles[200];
+void Levelm2Part7()
+{
+ frameleft=Infinity;
+ DisableAllTower=false;
+ if (IfShowTip)
+ {
+ IfShowTip=false;
+ FadeTip=false;
+ Current_Position=2;
+ ShowTip("Test 4 - Crossing 1");
+ All2pnt();
+ return;
+ }
+ if (towcnt!=0)return ClearAll(false);
+ if(Current_Position==1)
+ {
+ memset(asscircles,0,sizeof(asscircles));
+ ++part;avabrk=0;avacurbrk=0;
+ }
+}
+void Levelm2Part8()
+{
frameleft=Infinity;
- assetime+=hge->Timer_GetDelta();
avacurbrk+=hge->Timer_GetDelta();
if(avacurbrk>avabrk)
{
for(int i=0;i<200;++i)
- if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
- asscircles[i].Init(1,assetime/120.0f*0.00025,36,vector2d(250,300),blue);break;
+ if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
+ {
+ asscircles[i].Init(1,assetime/120.0f*0.00025,36,vector2d(250,300),blue);break;
+ }
for(int i=0;i<200;++i)
- if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
- asscircles[i].Init(1,-assetime/120.0f*0.00025,36,vector2d(550,300),blue);break;
+ if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
+ {
+ asscircles[i].Init(1,-assetime/120.0f*0.00025,36,vector2d(550,300),blue);break;
+ }
avacurbrk=0;
avabrk=3-assetime/60;
if(avabrk<0.5)avabrk=0.5;
@@ -3670,7 +3706,7 @@ void Levelm2Part6()
}
}
}
-void Levelm2Part7()
+void Levelm2Part9()
{
frameleft=Infinity;
DisableAllTower=false;
@@ -3679,14 +3715,13 @@ void Levelm2Part7()
IfShowTip=false;
FadeTip=false;
Current_Position=2;
- ShowTip("Test 4 - Crossing 2");
+ ShowTip("Test 5 - Crossing 2");
All2pnt();
return;
}
if (towcnt!=0)return ClearAll(false);
if(Current_Position==1)
{
- assetime=0;
for(int i=0;i<200;++i)
if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800)
asscircles[i].circ2pnt();
@@ -3694,19 +3729,22 @@ void Levelm2Part7()
++part;avabrk=0;avacurbrk=0;
}
}
-void Levelm2Part8()
+void Levelm2Part10()
{
frameleft=Infinity;
- assetime+=hge->Timer_GetDelta();
avacurbrk+=hge->Timer_GetDelta();
if(avacurbrk>avabrk)
{
for(int i=0;i<200;++i)
- if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
- asscircles[i].Init(1,0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break;
+ if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
+ {
+ asscircles[i].Init(1,0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break;
+ }
for(int i=0;i<200;++i)
- if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
- asscircles[i].Init(1,-0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break;
+ if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7)
+ {
+ asscircles[i].Init(1,-0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break;
+ }
avacurbrk=0;
avabrk=2-assetime/60;
if(avabrk<0.3)avabrk=0.3;
diff --git a/main.cpp b/main.cpp
index 5d44861..266f0c4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -366,8 +366,9 @@ 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 ((mode==2)&&coll!=0){assetime=0;++part;coll=0;IfCallLevel=IfShowTip=true;return;}
if (!IfCallLevel) return;
+ if (mode==2)assetime+=hge->Timer_GetDelta();
//Check Complete here
if (level==1&&part==0)Level1Part0();
if (level==1&&part==1)Level1Part1();
@@ -530,6 +531,8 @@ void CallLevels()
if (level==-2&&part==6)Levelm2Part6();
if (level==-2&&part==7)Levelm2Part7();
if (level==-2&&part==8)Levelm2Part8();
+ if (level==-2&&part==9)Levelm2Part9();
+ if (level==-2&&part==10)Levelm2Part10();
if (level==1&&part==5)level=2,part=0;
if (level==2&&part==10)
diff --git a/menus.h b/menus.h
index f3c2313..00757cc 100644
--- a/menus.h
+++ b/menus.h
@@ -78,7 +78,7 @@ void StartGUI_FrameFnk()
case 3:
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;
+ level=-2,part=0;frms=0,averfps=0.0;bsscale=1;assetime=0;
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();
diff --git a/towernbullet.h b/towernbullet.h
index d3d408c..f138ee8 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -2737,3 +2737,44 @@ public:
rad+=hge->Timer_GetDelta()*1000*delta;
}
};
+class expSpinner
+{
+private:
+ Bullet *bullets[1000];
+ int arms,cnt,lc;
+ double brk,len,dr,da;
+ bool active;
+ bool InBound(vector2d pos)
+ {
+ if (pos.x<=-25||pos.x>=825||pos.y<=-25||pos.y>=625)
+ return false;return true;
+ }
+public:
+ void Init(int _arms,double _drange,double _drad)
+ {
+ arms=_arms;lc=cnt=len=0;dr=_drange;da=_drad;active=true;
+ }
+ bool isActive(){return active;}
+ void Update()
+ {
+ brk+=hge->Timer_GetDelta();
+ if(brk<0.03)return;brk=0;
+ bool none=true;
+ for(int i=0;i<arms;++i)
+ {
+ double rad=da+i*2*pi/(double)arms,drad=rad+lc*pi/15;int c=(lc&1)?1:-1;
+ if(InBound(vector2d(400+len*cos(rad),300+len*sin(rad))))
+ {
+ bullets[cnt++]=&bullet[CreateBullet2(
+ 400+len*cos(rad),300+len*sin(rad),0,c*drad,true)];
+ c=-c;none=false;
+ }
+ }
+ len+=dr;++lc;
+ if(none)
+ {
+ active=false;
+ for(int i=0;i<cnt;++i)bullets[i]->bulletaccel=0.002,bullets[i]->limv=2;
+ }
+ }
+};