From e7174e25c6a6aef85014c1af3adf698e8446969b Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Wed, 26 Feb 2014 13:23:31 +0000 Subject: M resources/b_inter.png M trunk/CHANGELOG.TXT M trunk/VERSION.TXT M trunk/background.h M trunk/global.h M trunk/hge/sound.cpp M trunk/levels.h M trunk/main.cpp M trunk/towernbullet.h --- towernbullet.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 8 deletions(-) (limited to 'towernbullet.h') diff --git a/towernbullet.h b/towernbullet.h index 52fbe38..83abca4 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -89,6 +89,7 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool inv //bullet[i].bulletspr=new hgeSprite(SprSheet,0,0,24,24); //bullet[i].bulletspr->SetColor(0x80FFFFFF); bullet[i].scollable=true; + bullet[i].collable=true; bullet[i].bulletaccel=bullet[i].limv=0; bullet[i].scale=1; //bullet[i].bulletspr->SetHotSpot(12,12); @@ -403,15 +404,18 @@ void ProcessBullet2(int i) bullet[i].bullettype=0; return; } - if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7) + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable) //If collision is detected or the bullet flys out of screen, delete it. { - ++coll,scminus+=10000,Mult_BatClear(); - bullet[i].exist=false; - bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; - bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; - bullet[i].dist=0; - bullet[i].bullettype=0; + ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false; + if(!bullet[i].inv) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } return; } else @@ -1922,7 +1926,6 @@ public: } }; class WOP -//module: { private: int trail[200];//Pointer to bullet[] in this trail @@ -1969,3 +1972,55 @@ public: if (OutOfBound())active=false; } }; +class SimpleThing +{ +private: + vector2d center; + int step,cnt; + double rad,dly,lr,ra; + SimpleBullet b[500]; + double r[500],mr[500]; + bool create,rot; +public: + void Init(vector2d _ctr) + { + center=_ctr;step=cnt=dly=lr=ra=0; + create=true;rot=false; + } + void Update(bool rv) + { + dly+=hge->Timer_GetDelta(); + if(dly>0.2&&create) + { + dly=0; + for(int i=0;i<10;++i) + { + b[cnt].bulletpos=center; + b[cnt].aC=blue;b[cnt].aC2=COLOR_COUNT; + r[cnt/10]=0;mr[cnt/10]=(lr+=2); + if (lr>620)create=false; + ++cnt; + } + } + bool all=!create; + if(!rot) + for(int i=0;i