From 9884abca9d646fe3b27d95efc3a6d2211de45968 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Wed, 2 Apr 2014 13:12:38 +0000 Subject: New level, modify laser. --- towernbullet.h | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'towernbullet.h') diff --git a/towernbullet.h b/towernbullet.h index 3fc2fcd..2cba49c 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -1559,16 +1559,16 @@ private: vector2d data1[MaxRes],data2[MaxRes]; double GetDist() { - double res=99999.9999f; - double tres=99999.9999f; + double res=99999.9999f,tres; + static vector2d correction=vector2d(8.4,8.4); for (int i=0;i200) @@ -2828,3 +2828,35 @@ public: } } }; +class LineLaser:public Laser +{ +protected: + double width; + vector2d a,b; + DWORD color; +public: + void SetColl(bool col){EnableColl=col;} + void InitLine(vector2d _a,vector2d _b,double _w,DWORD _c) + { + a=_a;b=_b;color=_c;Init(2); + SetTexture(SprSheet,151,264,2,8); + SetWidth(_w);RenCtr=vector2d(0,0); + } + void SetWidth(double _w) + { + width=_w; + vector2d dir(a-b);dir.ToUnitCircle(); + vector2d pd=dir;pd.Rotate(pi/2); + Setdata(0,a-width*pd,a+width*pd,color); + for(int i=1;i