diff options
-rwxr-xr-x | CHANGELOG.TXT | 4 | ||||
-rw-r--r-- | global.h | 2 | ||||
-rw-r--r-- | levels.h | 50 | ||||
-rw-r--r-- | main.cpp | 2 | ||||
-rw-r--r-- | towernbullet.h | 13 |
5 files changed, 67 insertions, 4 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 4ffc93a..52255fd 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -3,6 +3,7 @@ Next version: 0.9.x-x_PR (b??) Todo's: Complete the game system. +Menu rewrite... Random segmentation fault in "Hyper-threading".(seen only once, can not reproduce now...) @@ -10,8 +11,9 @@ Pre-Released versions: 0.9.0-0_PR (b78) First two assessment levels. Two more assessment levels... -One more assessment level...... +Tow _more_ assessment levels...... Modify player attribute. +Allow bullet to kill itself at a certain point. Finish assessment system framework. Add circ2pnt. @@ -74,7 +74,7 @@ inline double GetDist(vector2d,vector2d); class Bullet { public: - vector2d bulletpos,bulletdir; + vector2d bulletpos,bulletdir,limpos; double dist; int bullettype,redexplo,redattrib,oriexplo,whicnt; DWORD sccolor; @@ -3759,3 +3759,53 @@ void Levelm2Part10() } } } +double assrad; +void Levelm2Part11() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 6 - Fake sink"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800) + asscircles[i].circ2pnt(); + memset(asscircles,0,sizeof(asscircles)); + ++part;avabrk=0;avacurbrk=0;assrad=0;tbrk=0; + } +} +void Levelm2Part12() +{ + frameleft=Infinity; + avacurbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + CreateBullet2(400,300,re.NextInt(1.5,3),re.NextDouble(-pi,pi)); + avacurbrk=0; + avabrk=0.05-0.03*assetime/120; + if(avabrk<0.01)avabrk=0.01; + } + if(tbrk>0.05) + { + for(int i=0;i<6;++i) + { + int pnt=CreateBullet2(400+305*cos(assrad+i*pi/3),305+280*sin(assrad+i*pi/3),1.5,0); + double r2=275.0f*(assetime/120.0f); + r2=305-r2;double r3=r2; + if(r2<1)r2=1; + bullet[pnt].redir(vector2d(400+r2*cos(assrad+i*pi/3),300+r2*sin(assrad+i*pi/3))); + bullet[pnt].limpos=vector2d(400+r3*cos(assrad+i*pi/3),300+r3*sin(assrad+i*pi/3)); + } + tbrk=0;assrad+=pi/60; + } +} @@ -533,6 +533,8 @@ void CallLevels() if (level==-2&&part==8)Levelm2Part8(); if (level==-2&&part==9)Levelm2Part9(); if (level==-2&&part==10)Levelm2Part10(); + if (level==-2&&part==11)Levelm2Part11(); + if (level==-2&&part==12)Levelm2Part12(); if (level==1&&part==5)level=2,part=0; if (level==2&&part==10) diff --git a/towernbullet.h b/towernbullet.h index f138ee8..71de714 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -71,8 +71,8 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool inv bullet[i].bullettype=2; bullet[i].bulletpos.x=x; bullet[i].bulletpos.y=y; - bullet[i].bulletdir.x=cos(rad); - bullet[i].bulletdir.y=sin(rad); + bullet[i].bulletdir=vector2d(cos(rad),sin(rad)); + bullet[i].limpos=vector2d(-999,-999); bullet[i].bulletspeed=bs; bullet[i].alterColor=blue; bullet[i].alterColor2=COLOR_COUNT; @@ -357,6 +357,15 @@ void ProcessBullet2(int i) bullet[i].whirem-=1000.0f/hge->Timer_GetFPS(); bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x)/20*(1000.0f/hge->Timer_GetFPS()); bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*(1000.0f/hge->Timer_GetFPS()); + if(GetDist(bullet[i].bulletpos,bullet[i].limpos)<1) + { + BulletEffect_Death(bullet[i],ColorToDWORD(bullet[i].alterColor)); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0;return; + } } BulletEffect_Process(i); if(PlayerSplit) |