aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-05 13:40:30 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-05 13:40:30 +0000
commit6cb0520416cb69d0461d62651eb1fbf48991d9cb (patch)
treef314e6800afeb883cb09df4a2ebc8e14052cb654
parent06373ac4a3dd68d2bd06224686b1e44aff50f54c (diff)
downloadbullet-lab-remix-6cb0520416cb69d0461d62651eb1fbf48991d9cb.tar.xz
One new level and fixes to several problems.
The code for Windows will be merged soon.
-rwxr-xr-xCHANGELOG.TXT22
-rwxr-xr-xVERSION.TXT2
-rw-r--r--global.h7
-rw-r--r--levels.h45
-rw-r--r--main.cpp9
-rw-r--r--towernbullet.h161
6 files changed, 223 insertions, 23 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index 9730ac6..c46e5b2 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -1,19 +1,34 @@
===================================================================
Next version:
-0.7.2-2_PR/0.7.3-0_PR
+0.7.3-0_PR
TODOs:
-Test classic mode, difficulty adjustments.
+Make multiplier function.
+Test classic mode, difficulty adjustments. Merge code for Windows.
P.S.: Level 1 may be too hard now.
-There's only one level left before the next pre-release version!!
0.7.x-x_PR will be another public pre-release version.
Pre-Released versions:
+0.7.2-2_PR (b72)
+New level "return to void". That's a 3 in 1 class. I used
+particularly many "return(void)(...);" in this level (which I
+always love to use).
+This indicates all "normal" levels are completed.
+Fixed: Trypophobia stops if too many CLR's are used.
+Fixed the problem in All2pnt().
+A Small bug in the Windows build is fixed.
+File list in the Windows build is updated.
+
0.7.2-1_PR (b71)
(Level7 will be almost twice longer than Level6!)
I'm extremely tired these days, I can't even keep my eyes open
while typing...
Some of my classmates helped testing several levels and found
some bugs, thanks a lot!
+
+After a short test, I found that the Windows build is almost
+broken... Crashes and misbehaves are everywhere!
+
+Maybe Windows is noble and won't run this garbage:(
===Real changelog starts from here===
New level "Trypophobia", however it seems that this level won't
cause trypophobia at all!
@@ -51,6 +66,7 @@ under Low FPS Mode.
Minor code cleanups.
Removed more useless comments, my code is still hard to comprehend,
though.
+Fix the misbehave of modulo with minus numbers...
Small interface and behaviour changes:
-If a bullet is effect-attatched and the effect is running, it won't
die.
diff --git a/VERSION.TXT b/VERSION.TXT
index 1c85f05..38fae88 100755
--- a/VERSION.TXT
+++ b/VERSION.TXT
@@ -1 +1 @@
-0.7.2-1_PR (b71) \ No newline at end of file
+0.7.2-2_PR (b72) \ No newline at end of file
diff --git a/global.h b/global.h
index d46c6cb..9ffa13c 100644
--- a/global.h
+++ b/global.h
@@ -303,7 +303,11 @@ void Error(const char *EC,bool hgecreated=false)
hge->Release();
}
#ifdef WIN32
- remove("./Resources/bg.png");
+ remove("./Resources/b_diff.png");
+ remove("./Resources/b_inter.png");
+ remove("./Resources/b_null.png");
+ remove("./Resources/e_sflake.png");
+ remove("./Resources/e_skyitem.png");
remove("./Resources/blnsns.png");
remove("./Resources/charmap.fnt");
remove("./Resources/ss.png");
@@ -315,6 +319,7 @@ void Error(const char *EC,bool hgecreated=false)
remove("./Resources/Music/BLR2_TR01.ogg");
remove("./Resources/Music/BLR2_TR07.ogg");
remove("./Resources/Music/BLR2_TR09.ogg");
+ remove("./Resources/Music/CanonTechno.ogg");
_rmdir("./Resources/Music");
_rmdir("./Resources");
#endif
diff --git a/levels.h b/levels.h
index 1f695c1..3c93499 100644
--- a/levels.h
+++ b/levels.h
@@ -2512,7 +2512,7 @@ void Level7Part8()
}
void rainbowCreator(double rl,double rr,double rad,TColors col,double speed,bool invi=false)
{
- double r=rand()%((int)(rr-rl)*10000)/10000.0f+rl;
+ double r=rand()%((int)(abs(rr-rl)*10000))/10000.0f+rl;
int pnt=CreateBullet2(900+cos(rad)*r,700+sin(rad)*r,speed,rand()/32767.0f,true,invi);
bullet[pnt].alterColor=col;
}
@@ -2945,8 +2945,37 @@ void Level7Part24()
for (int i=0;i<100;++i)
if (wop[i].active)wop[i].Update();
}
-//Rearrange needed since here, see LEVELS.txt
-void Level7Part25()//3 circles
+RTV rtv[100];
+void Level7Part25()
+{
+ frameleft=AMinute+ThirtySeconds;
+ All2pnt();towcnt=Lasercnt=0;
+ ++part;memset(rtv,0,sizeof(rtv));
+ avabrk=1;avacurbrk=0.7;
+}
+void Level7Part26()
+{
+ avacurbrk+=hge->Timer_GetDelta();
+ if(avacurbrk>avabrk&&frameleft>TenSeconds/3)
+ {
+ avacurbrk=0;avabrk=frameleft/(double)(AMinute+ThirtySeconds)*1.25+0.75;
+ for(int i=0;i<100;++i)if(!rtv[i].isActive())
+ {
+ int spinner=6;
+ if(frameleft<AMinute)spinner=8;
+ if(frameleft<ThirtySeconds)spinner=12;
+ if(rand()%100>40)rtv[i].Init(1,(rand()&1?1:-1)*pi/123,spinner,(TColors)(rand()%8),rand()%12);
+ else if(rand()&1)
+ rtv[i].Init(2,(rand()&1?1:-1)*pi/60,spinner,(TColors)(rand()%8),rand()%12);
+ else
+ rtv[i].Init(3,pi/48,spinner,(TColors)(rand()%8),rand()%12);
+ break;
+ }
+ }
+ for(int i=0;i<100;++i)if(rtv[i].isActive())rtv[i].Update();
+}
+//Level8 stats from here
+void Level7Part27()//3 circles
{
frameleft=AMinute;clrtime=2;towcnt=0;
DisableAllTower=false;
@@ -2973,7 +3002,7 @@ void L7P26Creator(vector2d p,int cnt,TColors col)
bullet[pnt].bulletaccel=-0.003;bullet[pnt].limv=((AMinute-frameleft)/(double)AMinute)+1.0f;
}
}
-void Level7Part26()
+void Level7Part28()
{
avacurbrk+=hge->Timer_GetDelta();
avabrk=(frameleft/(double)AMinute)*0.5f+0.5f;
@@ -2987,7 +3016,7 @@ void Level7Part26()
}
BCircle scircles[200];
double rspd[200];
-void Level7Part27()//circles
+void Level7Part29()//circles
{
frameleft=AMinute;clrtime=2;towcnt=0;
DisableAllTower=false;
@@ -3003,7 +3032,7 @@ void Level7Part27()//circles
++part;All2pnt();avabrk=1.0f;avacurbrk=1.0f;memset(scircles,0,sizeof(scircles));
}
}
-void Level7Part28()
+void Level7Part30()
{
avacurbrk+=hge->Timer_GetDelta();
avabrk=0.1+(frameleft/(double)AMinute)*0.4f;
@@ -3030,14 +3059,14 @@ void Level7Part28()
}
}
}
-void Level7Part29()//Minesweeper
+void Level7Part31()//Minesweeper
{
frameleft=AMinute;
All2pnt();towcnt=0;
Lasercnt=0;
++part;
}
-void Level7Part30()//Minesweeper-child
+void Level7Part32()//Minesweeper-child
{
if (rand()%100>95)
{
diff --git a/main.cpp b/main.cpp
index 5296b9e..7bc75b3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -449,6 +449,8 @@ void CallLevels()
if (level==7&&part==28)Level7Part28();
if (level==7&&part==29)Level7Part29();
if (level==7&&part==30)Level7Part30();
+ if (level==7&&part==31)Level7Part31();
+ if (level==7&&part==32)Level7Part32();
if (level==1&&part==5)level=2,part=0;
if (level==2&&part==10)level=3,part=0;
if (level==3&&part==7)level=4,part=0;
@@ -854,7 +856,11 @@ int main()
hge->System_Shutdown();
hge->Release();
#ifdef WIN32
- remove("./Resources/bg.png");
+ remove("./Resources/b_diff.png");
+ remove("./Resources/b_inter.png");
+ remove("./Resources/b_null.png");
+ remove("./Resources/e_sflake.png");
+ remove("./Resources/e_skyitem.png");
remove("./Resources/blnsns.png");
remove("./Resources/charmap.fnt");
remove("./Resources/ss.png");
@@ -866,6 +872,7 @@ int main()
remove("./Resources/Music/BLR2_TR01.ogg");
remove("./Resources/Music/BLR2_TR07.ogg");
remove("./Resources/Music/BLR2_TR09.ogg");
+ remove("./Resources/Music/CanonTechno.ogg");
_rmdir("./Resources/Music");
_rmdir("./Resources");
#endif
diff --git a/towernbullet.h b/towernbullet.h
index a5d643a..15899ac 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -299,12 +299,15 @@ void All2pnt()
{
for (int i=1;i<=bulcnt;++i)
{
- CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10);
- 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;
+ if(bullet[i].bullettype<200&&bullet[i].exist)
+ {
+ CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10);
+ 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;
+ }
}
}
void ProcessBullet1(int i)
@@ -1945,6 +1948,19 @@ private:
matrixx=_x;matrixy=_y;color=_col;
progress=1;cnt=0;
}
+ void kill()
+ {
+ for(int i=0;i<cnt;++i)
+ {
+ if(pb[i])
+ {
+ if(pb[i]->bullettype==2)
+ {
+ pb[i]->exist=false;pb[i]=0;
+ }
+ }
+ }
+ }
void update()
{
if(!progress)return;
@@ -1972,7 +1988,7 @@ private:
{
if(pb[i])
{
- if(pb[i]->lifetime>1)
+ if(pb[i]->bullettype==2&&pb[i]->lifetime>1)
{
BulletEffect_Death(*pb[i],ColorToDWORD(color));
pb[i]->exist=false;pb[i]=0;
@@ -1988,7 +2004,7 @@ private:
Pile piles[30];
bool tactive;
int listx[30],listy[30],cnt;
- TColors pcolor;
+ TColors pcolor;double tlifetime;
bool check(int x,int y)
{
if(x<0||x>15)return false;
@@ -2003,12 +2019,19 @@ public:
{
pcolor=(TColors)(rand()%8);tactive=true;
cnt=0;memset(listx,0,sizeof(listx));
- memset(listy,0,sizeof(listy));
+ memset(listy,0,sizeof(listy));tlifetime=0;
listx[cnt++]=rand()%16;listy[cnt-1]=rand()%12;
piles[cnt-1].create(listx[cnt-1],listy[cnt-1],pcolor);
}
void Update()
{
+ tlifetime+=hge->Timer_GetDelta();
+ if(tlifetime>15)
+ {
+ tactive=false;
+ for(int i=0;i<30;++i)
+ if(piles[i].getProgress())piles[i].kill();
+ }
if(piles[cnt-1].getProgress()==10)
{
int dlx[4],dly[4],dcnt=0;
@@ -2223,3 +2246,123 @@ public:
}
};
};
+class RTV
+{
+private:
+ int mode,cnt,stage,spnr,dcorr;
+ bool active;TColors col;
+ double drad,rad,brk;
+ Bullet *targ[600];
+public:
+ bool isActive(){return active;}
+ void Init(int _mode,double _drad,int _spnr,TColors _c,int _dcorr)
+ {
+ mode=_mode;drad=_drad;rad=0;spnr=_spnr;
+ brk=0;active=true;cnt=0;stage=0;col=_c;
+ memset(targ,0,sizeof(targ));dcorr=_dcorr;
+ }
+ void Update()
+ {
+ switch(mode)
+ {
+ case 1:
+ {
+ brk+=hge->Timer_GetDelta();
+ bool dchk=(stage==1);
+ for(int i=0;i<cnt;++i)
+ {
+ if(targ[i]->bulletspeed>1&&GetDist(vector2d(400,300),targ[i]->bulletpos)>=200)
+ targ[i]->bulletspeed=0;
+ if(targ[i]->bulletspeed>1)dchk=false;
+ }
+ if(dchk)
+ {
+ for(int i=0;i<cnt;++i)
+ {
+ double rad=atan2(targ[i]->bulletdir.y,targ[i]->bulletdir.x);
+ int cc=(int)(rad/drad);
+ if((cc/6+dcorr)&1)
+ targ[i]->bulletaccel=0.005,
+ targ[i]->limv=3;
+ else
+ targ[i]->bulletaccel=-0.005,
+ targ[i]->limv=-3;
+ }
+ return(void)(active=false);
+ }
+ if(stage==0)
+ {
+ if(brk>0.05)
+ {
+ brk=0;rad+=drad;
+ if(fabs(rad)>2*pi/spnr+pi/180)return(void)(stage=1);
+ for(int i=0;i<spnr;++i)
+ {
+ targ[cnt]=&bullet[CreateBullet2(400,300,2,rad+i*2*pi/spnr)],
+ targ[cnt]->inv=true,
+ targ[cnt++]->alterColor=col;
+ }
+ }
+ }
+ }
+ break;
+ case 2:
+ {
+ brk+=hge->Timer_GetDelta();
+ bool dchk=(stage==1);
+ for(int i=0;i<cnt;++i)
+ {
+ if(targ[i]->bulletspeed>1&&GetDist(vector2d(400,300),targ[i]->bulletpos)>=200)
+ targ[i]->bulletspeed=0;
+ if(targ[i]->bulletspeed>1)dchk=false;
+ }
+ if(dchk)
+ {
+ if(rand()%2)
+ for(int i=0;i<cnt;++i)
+ targ[i]->bulletaccel=-0.005,
+ targ[i]->limv=-3;
+ else
+ for(int i=0;i<cnt;++i)
+ targ[i]->bulletaccel=0.005,
+ targ[i]->limv=3;
+ return(void)(active=false);
+ }
+ if(stage==0)
+ {
+ if(brk>0.05)
+ {
+ brk=0;rad+=drad;
+ if(fabs(rad)>2*pi/spnr+pi/180)return(void)(stage=1);
+ for(int i=0;i<spnr;++i)
+ {
+ targ[cnt]=&bullet[CreateBullet2(400,300,2,rad+i*2*pi/spnr)],
+ targ[cnt]->inv=true;
+ targ[cnt++]->alterColor=col;
+ }
+ }
+ }
+ }
+ break;
+ case 3:
+ {
+ brk+=hge->Timer_GetDelta();
+ if(brk>0.05)
+ {
+ brk=0;rad+=drad;
+ if(fabs(rad)>2*pi/spnr+pi/180)return(void)(active=false);
+ for(int i=0;i<spnr;++i)
+ {
+ targ[cnt]=&bullet[CreateBullet2(400,300,2,rad+i*2*pi/spnr)];
+ targ[cnt]->inv=true;
+ targ[cnt++]->alterColor=col;
+ targ[cnt]=&bullet[CreateBullet2(400,300,2,-rad+i*2*pi/spnr)];
+ targ[cnt]->inv=true;
+ targ[cnt++]->alterColor=col;
+ }
+ }
+ }
+ break;
+ }
+ }
+};