From b3c3e0348f19125b5123d6f5c87e2cc91fd0172f Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Thu, 6 Mar 2014 02:59:55 +0000 Subject: Make multiplier system function, do some clean-ups. --- towernbullet.h | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'towernbullet.h') diff --git a/towernbullet.h b/towernbullet.h index 15899ac..38c55e4 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -8,12 +8,6 @@ #include "effects.h" //static const char* TOWERNBULLET_H_FN="towernbullet.h"; -void DirectBullet(Bullet &a,double rad) -{ - a.bulletdir.x=cos(rad); - a.bulletdir.y=sin(rad); - a.dist=1; -} void RenderAlter(vector2d p,TColors ca,TColors cb,double rot=0,double scl=1) { float x,y,w,h; @@ -799,6 +793,7 @@ void ProcessBullet255(int i) double dis=GetDist(bullet[i].bulletpos,playerpos); if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) { + score+=mult*100; bullet[i].exist=false; bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; @@ -1317,7 +1312,7 @@ void ProcessTower8() if (Dis8ref) { if (tower[i].towerpos.y<300) - DirectBullet(bullet[pnt],-pi/2);else DirectBullet(bullet[pnt],pi/2); + bullet[pnt].setdir(-pi/2);else bullet[pnt].setdir(pi/2); } if (tower[i].curshotcount==tower[i].shotcount) tower[i].tdir=bullet[pnt].bulletdir; @@ -1378,6 +1373,22 @@ private: hgeDistortionMesh *graphic; int Res; vector2d data1[MaxRes],data2[MaxRes]; + double GetDist() + { + double res=99999.9999f; + double tres=99999.9999f; + for (int i=0;iSetColor(Res-1,0,color);graphic->SetColor(Res-1,1,color); --Res; } - double GetDist() - { - double res=99999.9999f; - double tres=99999.9999f; - //Initalize: 999'99.9'999 - for (int i=0;iscale=0.01; + for (int i=0;isetdir(srad),Bul[i]->scale=0.01; Bul[0]->bulletspeed=2;Bul[0]->scale=1; } void stage0() -- cgit v1.2.3