diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-29 13:46:24 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-29 13:46:24 +0000 |
commit | 969bc3f4d0828d932b49bbff2ff6a4f2ac7c7926 (patch) | |
tree | 22beffaf33dfa272d63918008b07ecd7371f62de | |
parent | 942d51394f85ba5c0d3a62338f9c4fbe19c194b6 (diff) | |
download | bullet-lab-remix-969bc3f4d0828d932b49bbff2ff6a4f2ac7c7926.tar.xz |
New level "Pinball".
-rwxr-xr-x | CHANGELOG.TXT | 3 | ||||
-rw-r--r-- | levels.h | 46 | ||||
-rw-r--r-- | main.cpp | 2 | ||||
-rw-r--r-- | towernbullet.h | 39 |
4 files changed, 85 insertions, 5 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 9979d66..44ee83d 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -10,7 +10,8 @@ can not reproduce now...) Pre-Released versions: 0.9.0-1_PR (b79) Bump version! -New assessment level... +New assessment level "density test"... +New assessment level "pinball"... 0.9.0-0_PR (b78) First two assessment levels. @@ -3513,7 +3513,7 @@ void Levelm1Part21() } void Levelm2Part0() { - frameleft=50;All2pnt();towcnt=0; + frameleft=10;All2pnt();towcnt=0; DisableAllTower=false; if (IfShowTip) { @@ -3527,12 +3527,11 @@ 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; - return; + if((DBGColor=ColorTransfer(DBGColor,0xFF1B2065))!=0xFF1B2065)frameleft=10; + else{++part;bulcnt=0;return;} } } Tower* dbtows[200]; @@ -3903,3 +3902,42 @@ void Levelm2Part16() else resvpos+=re.NextInt(-1,1); } } +CPinBall pinballs[200]; +void Levelm2Part17() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 9 - Pinball"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;tbrk=0;memset(pinballs,0,sizeof(pinballs)); + } +} +void Levelm2Part18() +{ + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=1-0.5*assetime/120.0f;if(tbrk<0.5)tbrk=0.5; + for(int i=0;i<200;++i) + if(pinballs[i].Getlifetime()==0||pinballs[i].Getlifetime()>=10) + { + int lay=3+7*assetime/120.0f;if(lay>10)lay=10; + vector2d pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500)); + while(GetDist(pos,playerpos)<100)pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500)); + pinballs[i].Init(pos,lay); + break; + } + } + for(int i=0;i<200;++i) + if(pinballs[i].Getlifetime()>0&&pinballs[i].Getlifetime()<10)pinballs[i].Update(); +} @@ -539,6 +539,8 @@ void CallLevels() if (level==-2&&part==14)Levelm2Part14(); if (level==-2&&part==15)Levelm2Part15(); if (level==-2&&part==16)Levelm2Part16(); + if (level==-2&&part==17)Levelm2Part17(); + if (level==-2&&part==18)Levelm2Part18(); if (level==1&&part==5)level=2,part=0; if (level==2&&part==10) diff --git a/towernbullet.h b/towernbullet.h index 22c735b..3fc2fcd 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -2789,3 +2789,42 @@ public: } } }; +class CPinBall +{ +private: + Bullet* center; + Bullet* circles[10][30]; + int layer;double rot,lifetime,drt; +public: + void Init(vector2d pos,int _lay) + { + center=0;memset(circles,0,sizeof(circles)); + center=&bullet[CreateBullet2(pos.x,pos.y,3,re.NextInt(-pi,pi),true)]; + layer=_lay;rot=0;lifetime=0.01;drt=re.NextDouble(-0.5*pi,0.5*pi); + for(int i=0;i<layer;++i) + { + for(int j=0;j<(i+1)*3;++j) + { + circles[i][j]=&bullet[CreateBullet2(pos.x,pos.y,3,0,true)]; + circles[i][j]->bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3))); + } + } + } + double Getlifetime(){return lifetime;} + void Update() + { + lifetime+=hge->Timer_GetDelta(); + vector2d pos=center->bulletpos; + if(pos.x<10*layer-5||pos.x>790-10*layer)center->bulletdir.x=-center->bulletdir.x; + if(pos.y<10*layer-5||pos.y>590-10*layer)center->bulletdir.y=-center->bulletdir.y; + rot+=hge->Timer_GetDelta()*drt; + for(int i=0;i<layer;++i) + { + for(int j=0;j<(i+1)*3;++j) + { + circles[i][j]->bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3))); + circles[i][j]->bulletdir=center->bulletdir; + } + } + } +}; |