aboutsummaryrefslogtreecommitdiff
path: root/towernbullet.h
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-14 03:33:13 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-14 03:33:13 +0000
commitf9be9921e9c345549f7d506262dfde19bcc72088 (patch)
tree0c433811cdaec73ceb6cb14e2d02f45f69d0a6ab /towernbullet.h
parent30531dfb996a1c4b7c1975c7f234bec359b36668 (diff)
downloadbullet-lab-remix-f9be9921e9c345549f7d506262dfde19bcc72088.tar.xz
Draft another new level.
Diffstat (limited to 'towernbullet.h')
-rw-r--r--towernbullet.h77
1 files changed, 76 insertions, 1 deletions
diff --git a/towernbullet.h b/towernbullet.h
index 51f6d93..7331f9d 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -112,7 +112,7 @@ void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false)
bullet[i].bulletspeed=bs;
bullet[i].yelbrk=yelbrk;
bullet[i].scollable=true;
- bullet[i].scale=1;
+ bullet[i].scale=1;bullet[i].lifetime=0;
bullet[i].alterColor=yellow;bullet[i].alterColor2=COLOR_COUNT;
if (eff)BulletEffect_Attatch(i);
}
@@ -439,6 +439,7 @@ void ProcessBullet2(int i)
void ProcessBullet4(int i)
{
if (!bullet[i].exist||bullet[i].bullettype!=4)return;
+ if (Current_Position==1)bullet[i].lifetime+=hge->Timer_GetDelta();
if (!DisablePlayer)
{
if (LOWFPS)
@@ -2587,3 +2588,77 @@ public:
for(int i=0;i<500;++i)if(bullets[i].isActive())bullets[i].achromaUpdate();
}
};
+class yellowGroup
+{
+private:
+ Bullet *ylw[100];
+ bool dirdone[100];
+ bool active;
+public:
+ bool isActive(){return active;}
+ void Init(int _cnt,double _yv)
+ {
+ memset(ylw,0,sizeof(ylw));active=true;
+ memset(dirdone,0,sizeof(dirdone));
+ for (int i=0;i<_cnt;++i)
+ {
+ int pnt=CreateBullet2(400,300,_yv,frameleft*pi/AMinute+i*(2*pi/_cnt));
+ bullet[pnt].alterColor=yellow;
+ ylw[i]=&bullet[pnt];
+ }
+ }
+ void Update()
+ {
+ bool done=true;
+ for (int i=0;i<100;++i)
+ {
+ if(ylw[i]&&ylw[i]->lifetime>2&&!dirdone[i])
+ ylw[i]->redir(playerpos),dirdone[i]=true;
+ if(ylw[i]&&ylw[i]->lifetime>5)
+ {
+ int cc=re.NextInt(0,5);
+ for(int j=0;j<cc;++j)
+ {
+ int pnt=CreateBullet2(ylw[i]->bulletpos.x,ylw[i]->bulletpos.y,0,re.NextDouble(-pi,pi));
+ if(!re.NextInt(0,3))bullet[pnt].redir(playerpos);
+ bullet[pnt].bulletaccel=0.002;bullet[pnt].limv=3;
+ }
+ BulletEffect_Death(*ylw[i],ColorToDWORD(yellow));
+ ylw[i]->exist=false;
+ ylw[i]->bullettype=0;
+ ylw[i]=0;
+ }
+ else done=false;
+ }
+ if(done)active=false;
+ }
+};
+class Spinner
+{
+private:
+ SimpleBullet abullet[40][100];
+ int arms;
+ double rad,rstep;
+public:
+ void Init(int _arms,double _rstep)
+ {
+ memset(abullet,0,sizeof(abullet));
+ arms=_arms;rstep=_rstep;rad=0;
+ for(int i=0;i<arms;++i)
+ for(int j=0;j*rstep<505;++j)
+ {
+ abullet[i][j].aC=blue;abullet[i][j].aC2=COLOR_COUNT;
+ }
+ }
+ void Update(double delta)
+ {
+ for(int i=0;i<arms;++i)
+ for(int j=0;j*rstep<505;++j)
+ {
+ double crad=rad+i*(2*pi/arms);
+ abullet[i][j].bulletpos=vector2d(400+j*rstep*cos(crad),300+j*rstep*sin(crad));
+ abullet[i][j].Update_SimpBul();
+ }
+ rad+=hge->Timer_GetDelta()*1000*delta;
+ }
+};