diff options
-rwxr-xr-x | CHANGELOG.TXT | 3 | ||||
-rw-r--r-- | levels.h | 82 | ||||
-rw-r--r-- | main.cpp | 2 | ||||
-rw-r--r-- | towernbullet.h | 4 |
4 files changed, 88 insertions, 3 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index b1a6a2c..38a59f8 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -7,11 +7,14 @@ Add missing tips. Pre-Released versions: 0.8.1-0_PR (b76) New level "Sink" (temporary name). +New level "Gravity vortex". +Make point bullet additive blending. Allow bullets to pause before being accelerated. 0.8.0-1_PR (b75) New level Supernova. New level (still unnamed). +Support additive blending bullets(for Supernova). Add some additional tips. Fix blinking of HGE::Gfx_SetTransform in OpenGL. Fix includes like " #include "../../include/..." " that would @@ -3319,7 +3319,7 @@ void Levelm1Part17() frameleft=AMinute+ThirtySeconds;towcnt=0; All2pnt();memset(m17lead,0,sizeof(m17lead)); ++part; - m17lead[0]=&bullet[CreateBullet2(10,10,4,0)];m17lead[0]->redir(vector2d(790,10));m17lead[0]->alterColor=red; + m17lead[0]=&bullet[CreateBullet2(10,10,4,0)];m17lead[0]->redir(vector2d(780,10));m17lead[0]->alterColor=red; m17lead[1]=&bullet[CreateBullet2(780,10,4,0)];m17lead[1]->redir(vector2d(780,580));m17lead[1]->alterColor=green; m17lead[2]=&bullet[CreateBullet2(780,580,4,0)];m17lead[2]->redir(vector2d(10,580));m17lead[2]->alterColor=dblue; m17lead[3]=&bullet[CreateBullet2(10,580,4,0)];m17lead[3]->redir(vector2d(10,10));m17lead[3]->alterColor=white; @@ -3371,9 +3371,87 @@ void Levelm1Part18() int pnt=CreateBullet2(m17lead[i]->bulletpos.x,m17lead[i]->bulletpos.y,0,0,true); bullet[pnt].redir(snexTarg.targpos); bullet[pnt].bulletaccel=0.002;bullet[pnt].limv=3; - bullet[pnt].whirem=500+(frameleft/(double)(AMinute+ThirtySeconds))*750; + bullet[pnt].whirem=1500-(frameleft/(double)(AMinute+ThirtySeconds))*500; bullet[pnt].alterColor=i==0?red:i==1?green:i==2?dblue:white; } tbrk=0; } } +Bullet *m19lead[10],*m19gen[700]; +double m19rad; +int m19step,m19cnt; +void Levelm1Part19() +{ + frameleft=AMinute*2;towcnt=0; + All2pnt();memset(m19lead,0,sizeof(m19lead)); + memset(m19gen,0,sizeof(m19gen)); + ++part;m19rad=m19step=m19cnt=0; + avabrk=0.05;avacurbrk=0; + for(int i=0;i<8;++i) + { + m19lead[i]=&bullet[CreateBullet2(400,300,0,0)]; + m19lead[i]->bulletpos=vector2d(400+250*cos(m19rad+i*pi/4),300+250*sin(m19rad+i*pi/4)); + m19lead[i]->alterColor=(TColors)i; + m19lead[i]->inv=true; + } +} +void Levelm1Part20update() +{ + for(int i=0;i<m19cnt;++i) + { + if(m19gen[i]->redattrib) + { + if(m19gen[i]->redattrib>1) + { + double r=re.NextDouble(0,75-50*(frameleft/(double)(AMinute*2))),theta=re.NextDouble(-pi,pi); + m19gen[i]->bulletpos=vector2d(400+r*cos(theta),300+r*sin(theta)); + m19gen[i]->bulletspeed=0; + } + else + { + if(GetDist(m19gen[i]->bulletpos,vector2d(400,300))<4) + { + m19gen[i]->redattrib=2; + m19gen[i]->setdir(re.NextDouble(-pi,pi)); + m19gen[i]->bulletaccel=0.0015; + m19gen[i]->limv=re.NextDouble(2,6); + } + } + } + } +} +void Levelm1Part20() +{ + avacurbrk+=hge->Timer_GetDelta(); + m19rad+=pi/(5400.0f+1800.0f*(frameleft/(double)(AMinute*2)))*(1000.0f/hge->Timer_GetFPS()); + for(int i=0;i<8;++i)m19lead[i]->bulletpos=vector2d(400+250*cos(m19rad+i*pi/4),300+250*sin(m19rad+i*pi/4)); + switch(m19step) + { + case 0: + if(avacurbrk>avabrk) + { + for(int i=0;i<8;++i) + { + m19gen[m19cnt]=&bullet[CreateBullet2(m19lead[i]->bulletpos.x,m19lead[i]->bulletpos.y,0,0)]; + m19gen[m19cnt]->redir(vector2d(400,300)); + m19gen[m19cnt]->alterColor=(TColors)i; + m19gen[m19cnt]->bulletaccel=0.002; + m19gen[m19cnt]->limv=3; + m19gen[m19cnt]->whirem=1000; + m19gen[m19cnt]->addblend=true; + m19gen[m19cnt++]->redattrib=re.NextInt(0,3)?0:1; + } + if(m19cnt/8>80-50*(frameleft/(double)(AMinute*2)))m19step=1,avabrk=3; + avacurbrk=0; + } + Levelm1Part20update(); + break; + case 1: + if(avacurbrk>avabrk) + { + m19step=0;avabrk=0.05;memset(m19gen,0,sizeof(m19gen));m19cnt=0; + } + Levelm1Part20update(); + break; + } +} @@ -514,6 +514,8 @@ void CallLevels() if (level==-1&&part==16)Levelm1Part16(); if (level==-1&&part==17)Levelm1Part17(); if (level==-1&&part==18)Levelm1Part18(); + if (level==-1&&part==19)Levelm1Part19(); + if (level==-1&&part==20)Levelm1Part20(); if (level==1&&part==5)level=2,part=0; if (level==2&&part==10)level=3,part=0; if (level==3&&part==7)level=4,part=0; diff --git a/towernbullet.h b/towernbullet.h index f5fd77a..18667a6 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -954,8 +954,10 @@ void ProcessBullet255(int i) } else { - bulletspr[grey]->SetColor(0x80FFFFFF); + bulletspr[grey]->SetColor(0x10FFFFFF); + bulletspr[grey]->SetBlendMode(BLEND_ALPHAADD); bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+6,bullet[i].bulletpos.y+6,0,0.5,0); + bulletspr[grey]->SetBlendMode(BLEND_ALPHABLEND); } } int CreateTower1(double x,double y,int timer,double bs,double offset=0,bool eff=false) |