From 8635e927b86a6336d887f19c776579bb3f715b32 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Sat, 18 Jan 2014 02:29:44 +0000 Subject: M trunk/levels.h M trunk/main.cpp M trunk/towernbullet.h --- levels.h | 25 +++++++++++++++++++++++-- main.cpp | 9 --------- towernbullet.h | 57 ++++++++++++++++++++++++++++++++++++++++----------------- 3 files changed, 63 insertions(+), 28 deletions(-) diff --git a/levels.h b/levels.h index eae7c72..12fe52e 100644 --- a/levels.h +++ b/levels.h @@ -2552,7 +2552,7 @@ void Level7Part5()//This should be another part. { memset(bnl,0,sizeof(bnl)); frameleft=AMinute; - ykbrk=1.0f; + ykbrk=1.0f;++part; } void Level7Part6() { @@ -2561,7 +2561,28 @@ void Level7Part6() { ykbrk=1.0f; for (int i=0;i<100;++i) - if (!bnl[i].active){bnl[i].Init(vector2d(rand()%800,rand()%600),vector2d(rand()%800,rand()%600));break;} + if (!bnl[i].active) + { + vector2d a,b; + if (rand()%100>49) + { + if (rand()%100>49)a=vector2d(rand()%780+10,590);else a=vector2d(rand()%780+10,10); + } + else + { + if (rand()%100>49)a=vector2d(10,rand()%580+10);else a=vector2d(790,rand()%580+10); + } + if (rand()%100>49) + { + if (rand()%100>49)b=vector2d(rand()%780+10,590);else b=vector2d(rand()%780+10,10); + } + else + { + if (rand()%100>49)b=vector2d(10,rand()%580+10);else b=vector2d(790,rand()%580+10); + } + bnl[i].Init(a,b); + break; + } } for (int i=0;i<100;++i) if (bnl[i].active)bnl[i].Update(); diff --git a/main.cpp b/main.cpp index c33ed08..89f8046 100644 --- a/main.cpp +++ b/main.cpp @@ -693,15 +693,6 @@ int main() if (_mkdir("./Resources")!=0||_mkdir("./Resources/Music")!=0) Error("Cannot decompress resources!\nDetailed Information: An error occured while creating folder.\n\nTry restarting the game."); hge->System_Log("Folders created successfully."); - /*Expand("./Resources/bg.lz","./Resources/bg.png"); - Expand("./Resources/blnsns.lz","./Resources/blnsns.png"); - Expand("./Resources/charmap.lz","./Resources/charmap.fnt"); - Expand("./Resources/ss.lz","./Resources/ss.png"); - Expand("./Resources/title.lz","./Resources/title.png"); - Expand("./Resources/credits.lz","./Resources/credits.png"); - Expand("./Resources/b_leaves.lz","./Resources/b_leaves.png"); - Expand("./Resources/e_leaf.lz","./Resources/e_leaf.png"); - Expand("./Resources/tap.lz","./Resources/tap.ogg");*/ Expand("BLRData.dtp","Resources"); Expand("BLRMusic.dtp","Resources/Music"); hge->System_Log("Resources decompressed successfully."); diff --git a/towernbullet.h b/towernbullet.h index cef4923..b38442f 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -1431,6 +1431,7 @@ public: bool EnableColl; vector2d RenCtr; int collbrk,scollbrk; + void SetRes(int _Res){Res=_Res;} void Render() { graphic->Render(RenCtr.x,RenCtr.y); @@ -1484,11 +1485,18 @@ public: double res=99999.9999f; double tres=99999.9999f; //Initalize: 999'99.9'999 - for (int i=1;iSetColor(0x80FFFFFF); @@ -1560,12 +1570,14 @@ void ProcessBullet2(Bullet &xbul) { if (xbul.bulletspeed=900||xbul.bulletpos.y<=-100||xbul.bulletpos.y>=700) { xbul.exist=false; @@ -1573,6 +1585,13 @@ void ProcessBullet2(Bullet &xbul) xbul.bulletdir.x=xbul.bulletdir.y=0; xbul.bullettype=0; }*/ + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7) + //If collision is detected or the bullet flys out of screen, delete it. + { + ++coll,scminus+=10000,Mult_BatClear(); + return; + } + if (dis<=16&&xbul.scollable)++semicoll,++dsmc,xbul.scollable=false,SCEffect_Attatch(); xbul.bulletspr->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.5); } //"Noname" @@ -1846,14 +1865,18 @@ public: line.SetTexture(SprSheet,0,264,248,8); line.RenCtr.x=line.RenCtr.y=0; line.EnableColl=false; - CreateBullet2(headb,a.x,b.x,2,0); - double theta=(a.y-b.y,a.x-b.x); - vector2d a2=vector2d(a.x+0.5*sin(theta),a.y+0.5*cos(theta)); - vector2d b2=vector2d(b.x+0.5*sin(theta),b.y+0.5*cos(theta)); - line.InsPoint(a,a2,0x33CCFF); - while(line.InsPoint(b,b2,0x33CCFF)); + CreateBullet2(headb,a.x,b.x,6,0); headb.redir(b); + double theta=(a.y-b.y,a.x-b.x); + vector2d a2=vector2d(a.x+4*sin(theta),a.y+4*cos(theta)); + vector2d b2=vector2d(b.x+4*sin(theta),b.y+4*cos(theta)); + //line.InsPoint(a,a2,0xCC33CCFF); + //while(line.InsPoint(b,b2,0xCC33CCFF)); + line.SetRes(3); + line.Setdata(0,a,a2,0xCC33CCFF); + for (int i=1;i<80;++i)line.Setdata(i,b,b2,0xCC33CCFF); active=true; + lifetime=0; } void Update() { -- cgit v1.2.3