aboutsummaryrefslogtreecommitdiff
path: root/towernbullet.h
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 /towernbullet.h
parente33464c9892a8dc26cb0ea2a6e6c3e3585a1f518 (diff)
downloadbullet-lab-remix-bd9f7d7edf3775f644003887dfa195e9a8b9f54a.tar.xz
One more level, fix compile error...
Diffstat (limited to 'towernbullet.h')
-rw-r--r--towernbullet.h41
1 files changed, 41 insertions, 0 deletions
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;
+ }
+ }
+};