From 5422ce494b3a83ece8f12156e7498cc9ce313539 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Thu, 13 Feb 2014 16:32:47 +0000 Subject: M resources/ss.png M trunk/CHANGELOG.TXT M trunk/VERSION.TXT M trunk/global.h M trunk/levels.h M trunk/libcgh.h M trunk/main.cpp M trunk/towernbullet.h --- CHANGELOG.TXT | 14 +++++++++++++- VERSION.TXT | 2 +- global.h | 1 + levels.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- libcgh.h | 8 +++++++- main.cpp | 4 ++++ towernbullet.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 7 files changed, 125 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index aa76270..13fc4f9 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,8 +1,20 @@ =================================================================== Next version: -0.7.1-1_PR +0.7.1-2_PR +TODOs: +Bullet die effect (Resource is ready now), apply it to Wave of +Photon. +Try fake multi-thread effect loading. Pre-Released versions: +0.7.1-1_PR (b64) +New level: Wave of Photon. A lazy level again. Despite of a new +class, it's a copy of "photon school". +Level improved: Cross threaten. Make it impossible to pass this +part without crossing those blue bullets. +libcgh improvement. Added new interfaces to vector2d struct. So the +libcgh version was bumped. Was it worth doing that? + 0.7.1-0_PR (b63) New level: Rainbow bullets - nauty photon (in fact it's a lazy level! I must have seen the same thing some where else...) diff --git a/VERSION.TXT b/VERSION.TXT index f1f6bdf..671ef84 100755 --- a/VERSION.TXT +++ b/VERSION.TXT @@ -1 +1 @@ -0.7.1-0_PR (b63) \ No newline at end of file +0.7.1-1_PR (b64) \ No newline at end of file diff --git a/global.h b/global.h index 301a855..860569e 100644 --- a/global.h +++ b/global.h @@ -47,6 +47,7 @@ Bullet White 168,0,24,24 Bullet Yellow 192,0,24,24 Cursor 216,0,24,24 Player 0,24,24,24 +Bullet Circle 24,24,24,24 Tower Blue 0,48,44,44 Tower Dark Blue 0,92,44,44 Tower Green 0,136,44,44 diff --git a/levels.h b/levels.h index d6358aa..e14cfc2 100644 --- a/levels.h +++ b/levels.h @@ -1384,13 +1384,15 @@ void Level5Part10() tbrk+=hge->Timer_GetDelta(); if (tbrk<=3)return; tbrk=0; - int p=CreateBullet1(playerpos.x,12,2); - //bullet[p].bulletspr->SetTextureRect(72,0,24,24); - bullet[p].alterColor=orange; + for (int i=0;i<6;++i) + { + int p=CreateBullet2(playerpos.x+cos(i*pi/3.0f)*6,12+sin(i*pi/3.0f)*6,2,-pi/2); + bullet[p].alterColor=orange; + } } void Level5Part11() { - frameleft=TenSeconds/10*2;clrtime=0; + frameleft=TenSeconds/10*2;clrtime=0;Dis8ref=false; if (towcnt==66) { ClearAll(); @@ -2665,6 +2667,46 @@ void Level7Part9() for (int i=0;i<100;++i) if (bnl[i].active)bnl[i].Update(); } +WOP wop[100]; +void Level7Part10() +{ + memset(bnl,0,sizeof(bnl)); + frameleft=AMinute; + ykbrk=0.5f;++part; +} +void Level7Part11() +{ + ykbrk-=hge->Timer_GetDelta(); + if (ykbrk<0&&frameleft>TenSeconds/10*3) + { + ykbrk=(double)frameleft/AMinute/2.0f+0.2f; + for (int i=0;i<100;++i) + if (!wop[i].active) + { + vector2d a,b; + if (rand()%100>49) + { + if (rand()%100>49)a=vector2d(rand()%780+10,610);else a=vector2d(rand()%780+10,-10); + } + else + { + if (rand()%100>49)a=vector2d(-10,rand()%580+10);else a=vector2d(810,rand()%580+10); + } + if (rand()%100>49) + { + if (rand()%100>49)b=vector2d(rand()%780+10,610);else b=vector2d(rand()%780+10,-10); + } + else + { + if (rand()%100>49)b=vector2d(-10,rand()%580+10);else b=vector2d(810,rand()%580+10); + } + wop[i].Init(a,b,1000+(AMinute-frameleft)/(double)AMinute*1000,0.02); + break; + } + } + for (int i=0;i<100;++i) + if (wop[i].active)wop[i].Update(); +} //vvvvvvvvvvvvvvvvvvvvvv Old Levels vvvvvvvvvvvvvvvvvvvvvv// /*void Level1Part2()//Simple tower8-discard { diff --git a/libcgh.h b/libcgh.h index 00ad967..943601f 100644 --- a/libcgh.h +++ b/libcgh.h @@ -1,7 +1,7 @@ //Chrisoft Bullet Lab Remix HGE //Chrisoft Game Helper header //"Copyleft" Chrisoft 2013 -//libcgh version 0002 +//libcgh version 0003 //^Modify that when big change is made^ #include #include @@ -19,6 +19,12 @@ struct vector2d double x,y; vector2d(double _x,double _y){x=_x;y=_y;} vector2d(){x=y=0;} + void ToUnitCircle() + { + double l=sqrt(sqr(x)+sqr(y)); + x/=l;y/=l; + } + void Swap(){double t=x;x=y;y=t;} friend vector2d operator -(vector2d a,vector2d b) { return vector2d(a.x-b.x,a.y-b.y); diff --git a/main.cpp b/main.cpp index 76f0d26..7670dca 100644 --- a/main.cpp +++ b/main.cpp @@ -401,6 +401,10 @@ void CallLevels() if (level==7&&part==5)Level7Part5(); if (level==7&&part==6)Level7Part6(); if (level==7&&part==7)Level7Part7(); + if (level==7&&part==8)Level7Part8(); + if (level==7&&part==9)Level7Part9(); + if (level==7&&part==10)Level7Part10(); + if (level==7&&part==11)Level7Part11(); /*if (level==1&&part==3)Level1Part3(); if (level==1&&part==4)Level1Part4(); if (level==1&&part==5)Level1Part5(); diff --git a/towernbullet.h b/towernbullet.h index 42e84c8..3f48557 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -1579,7 +1579,7 @@ void CreateBullet2(Bullet &Tar,double x,double y,double bs,double rad,bool eff=f //Tar.bulletspr->SetColor(0x80FFFFFF); //Tar.bulletspr->SetHotSpot(12,12); } -void ProcessBullet2(Bullet &xbul) +void ProcessBullet2(Bullet &xbul,bool colchk=true) { if (xbul.bulletspeedRenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.5); - bulletspr[xbul.alterColor]->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.6*xbul.scale); + if (colchk)bulletspr[xbul.alterColor]->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.6*xbul.scale); } //"Noname" class Noname01dotpas @@ -1875,8 +1875,8 @@ private: int gencnt; bool OutOfBound() { - if (headb.bulletpos.x<=-25||headb.bulletpos.x>=825||headb.bulletpos.y<=-25||headb.bulletpos.y>=625) - return true;return false; + if (headb.bulletpos.x<=-25||headb.bulletpos.x>=825||headb.bulletpos.y<=-25||headb.bulletpos.y>=625) + return true;return false; } public: bool active; @@ -1910,3 +1910,51 @@ public: ProcessBullet2(headb); } }; +class WOP +//module: +{ +private: + int trail[200];//Pointer to bullet[] in this trail + double brk,blim,rad,k;//step break + vector2d a,b; + int ml; + Bullet hbul;//hidden header bullet, no col. + bool OutOfBound() + { + if (hbul.bulletpos.x<=-25||hbul.bulletpos.x>=825||hbul.bulletpos.y<=-25||hbul.bulletpos.y>=625) + { + for (int i=0;i<200;++i)if (trail[i])return false; + return true; + }return false; + } +public: + bool active; + void Init(vector2d _a,vector2d _b,int _ml,double _bl)//ml=Max Length, bl=BLumia + { + a=_a,b=_b,ml=_ml,blim=_bl;rad=0; + if (fabs(b.x-a.x)<1e-6)return;k=(b.y-a.y)/(b.x-a.x); + CreateBullet2(hbul,a.x,a.y,7,0);hbul.redir(b); + active=true;memset(trail,0,sizeof(trail)); + } + void Update() + { + ProcessBullet2(hbul); + brk+=hge->Timer_GetDelta(); + if (brk>blim) + { + brk=0; + for (int i=0;i<200;++i) + { + if (trail[i]) + if (bullet[trail[i]].lifetime>ml)bullet[trail[i]].exist=false,trail[i]=0; + } + rad+=pi/16.0f; + vector2d uv=ToUnitCircle(vector2d(1,-k));uv.Swap(); + int pnt=0;while (trail[pnt])++pnt; + trail[pnt]=CreateBullet2(hbul.bulletpos.x+uv.x*50*sin(rad),hbul.bulletpos.y+uv.y*50*sin(rad),0,0,true); + pnt=0;while (trail[pnt])++pnt; + trail[pnt]=CreateBullet2(hbul.bulletpos.x-uv.x*50*sin(rad),hbul.bulletpos.y-uv.y*50*sin(rad),0,0,true); + } + if (OutOfBound())active=false; + } +}; -- cgit v1.2.3