summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-06-19 11:51:22 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-06-19 11:51:22 +0000
commit7495d8ca26cdb25056667ae8a8d860005ee2a68f (patch)
treeb23b678105d9a6b61d8867b60a9497e40833862d
parentd747c360427071a329bed01b1fb33aab6b87c568 (diff)
downloadbullet-lab-remix-7495d8ca26cdb25056667ae8a8d860005ee2a68f.tar.xz
Add player position display into debug display.
Rewrite pinball, adding collision between the balls... The collision code is based on Kollision (a game included in KDE SC).
-rwxr-xr-xChangeLog14
-rw-r--r--Readme46
-rw-r--r--Readme.zh60
-rwxr-xr-xVERSION2
-rw-r--r--global.h6
-rw-r--r--hgeft.h2
-rw-r--r--levels.h49
-rw-r--r--main.cpp5
-rw-r--r--towernbullet.h46
9 files changed, 161 insertions, 69 deletions
diff --git a/ChangeLog b/ChangeLog
index 83d584a..9bcf684 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,9 @@
===================================================================
Next version:
-?
+The final release is just there!!
Todo's:
-Add multpo's.
+*Adjust difficulty!*
+*Add multpo's.*
Bug fixes.
Tests.
Wishlist?
@@ -18,9 +19,18 @@ In-game music bring back.
of next BLR.)
Pre-Released versions:
+0.9.1-4 (r93)
+Picking it up after almost one month... I'm now lost in my code...
+---------------------------------------------------------------------------------
+Add player position display into debug display.
+Rewrite pinball, adding collision between the balls...
+The collision code is based on Kollision (a game included in KDE SC).
+
0.9.1-3 (r92)
I installed Archlinux alongside Debian recently. Now we officially support
Archlinux and Debian.
+Archlinux doesn't eat my CPU or try to destroy it... So further development will
+be made mainly under archlinux...
---------------------------------------------------------------------------------
Content freeze -- nothing will be added or removed any more (music etc excluded).
Fix build failure in Archlinux.
diff --git a/Readme b/Readme
index 2e4c8cc..9698b0d 100644
--- a/Readme
+++ b/Readme
@@ -8,6 +8,28 @@ NOTE: This is a pre-release version. That means:
BulletLabRemix II readme
+Content
+------------------------------------------------------------------------------------
+What's this?
+Story
+Generic Information
+Menus
+Game Modes
+Command line options
+About the author
+"Black History"
+Brief History
+
+What's this?
+------------------------------------------------------------------------------------
+"As the name tells", it's the continue, or "free" replacement of Bullet LAB from
+Game Boltz, which is a tiny flash game. Having no proprietary software dependences,
+it's goal is making the original game "free" and more challanging.
+
+This is the second work of BulletLabRemix. Compared to the first work, it's much
+more mature. However, it's still far away from a complete "framework". And it may
+be full of bugs...
+
Story
------------------------------------------------------------------------------------
THE STORY OF THE COLOURS
@@ -80,8 +102,9 @@ Basic environment:
CPU: Atom 1.6GHz will even work.
RAM: 1GiB
GPU&VRAM: Not worse than Intel HD Graphics.
-OS: Windows XP+ & DirectX9+ / Linux kernel 2.6+ & OpenGL 1.2+
+OS: Windows XP+ & DirectX 9 / Linux kernel 2.6+ & OpenGL 1.2+
Recommended environment:
+CPU: Lots of cores.
GPU&VRAM: Very fast graphic rendering.
Sound: Ability to run OpenAL software version.
@@ -138,7 +161,7 @@ Go for the highest score!
Free Play Mode
You'll never die! Enjoy!...
-Command line options
+
------------------------------------------------------------------------------------
Yes, it accept command line options! (And some of them may be very useful...)
You can override your settings with them if you can't start it after changing the settings.
@@ -192,6 +215,8 @@ Several "testbed" version was created over the code base of BLRI.
Then the pre-release version created. Almost all original code from BLRI is removed.
Now it has reached a position that I've never expected...
+See "The development" in the file "Extras" for more details.
+
Brief History
------------------------------------------------------------------------------------
The file ChangeLog contains the full history of this project.
@@ -214,4 +239,19 @@ Contains several bug fixes.
0.2.9-1_PR (b21)
First public prerelease version.
Comes with two levels.
-Introduced multiplier system, not functional yet. \ No newline at end of file
+Introduced multiplier system, not functional yet.
+
+0.1.7-2_PR (b16)
+Level 1 is finished.
+
+TB130907 (b10)
+Laser implementation rev 2.
+
+TB130827 (b8)
+Initial laser implementation.
+
+TB130620~TB130818 (b1~b7)
+New towers and new levels.
+
+TB130610 (b0)
+Creation of the Testbed version. \ No newline at end of file
diff --git a/Readme.zh b/Readme.zh
index ea7f3ac..ebac9f4 100644
--- a/Readme.zh
+++ b/Readme.zh
@@ -8,6 +8,13 @@ This text is encoded in UTF-8.
BulletLabRemix II Readme - 一个类似机翻的中文版
+这是什么?
+------------------------------------------------------------------------------------
+“正如名字告诉你的”,它是GameBoltz的一个小flash游戏——Bullet LAB的延续,或者“等价”的“自由”替代品。
+它不依赖任何专有的软件。它的目标是让原游戏变得“自由”并且更具挑战性。
+这是BulletLabRemix的第二个版本。与第一个版本比起来,它成熟得多。但是,它离一个完整的“框架”还差得远。
+并且它还有可能到处是bug…
+
背景
------------------------------------------------------------------------------------
//听说已经是高中英语完型填空了,就偷懒不翻译了…
@@ -78,11 +85,12 @@ After a catastrophic disaster, they found some of them were missing...
运行环境要求&推荐项目
必需环境:
-CPU: Atom 1.6GHz也能运行。
+CPU: Atom 1.6GHz都行
RAM: 1GiB
GPU&VRAM: 不能比Intel HD Graphics更差的吧?
-操作系统: Windows XP+ & DirectX9+ / Linux kernel 2.6+ & OpenGL 1.2+
+操作系统: Windows XP+ & DirectX 9 / Linux kernel 2.6+ & OpenGL 1.2+
推荐环境:
+CPU: 大量的处理器核心。
GPU&VRAM: 非常快的渲染速度。
声音: 能够运行OpenAL软件版。
@@ -174,7 +182,7 @@ Free Play Mode 自由模式
历史
------------------------------------------------------------------------------------
这个工程本来只是作为一个BulletLab的hge&C++重写开始的。
-由于不明的原因,它越来越大,甚至都改变了hge的核心。
+由于未知的原因,它越来越大,甚至都改变了hge的核心。
工程开始几个月后,BLRI(The Creature of Colour)发布了。
当BLRI快要完成的时候,BLRII从BLRI中fork了出来。
@@ -187,44 +195,24 @@ Free Play Mode 自由模式
ChangeLog包含了该工程的全部历史。
这里是一个「里程碑」的列表。
-0.9.1-0_PR (r85)
-Menu rewrite(still in progress).
-
-0.9.0-1_PR (b79/r79)
-Finish assessment mode.
-Extend laser class.
-Several modify and fix to HGE.
-
-0.8.1-1_PR (b77)
-Completing all levels for Classic Mode and Free Play Mode.
-Switch to mingw-w64 for building Windows version.
-Prepare for assessment mode.
+0.9.1-1_PR (r86)
+Current public release. Comes with all levels that will appear in the final release.
+Done menu rewrite.
+Make multiplier system functional.
0.7.3-0_PR (b73)
-Completing level 7.
-Lots and lots of fixes.
-Laser revesion is now r5 and work perfectly.
-
-0.6.2-2_PR (b52)
-Level 6 is complete.
-Supporting new music interfaces and added in-game music.
-
-0.5.3-2_PR (b43)
-Finishing level 5.
-New clear range trigger method and fixes to clear range.
+Comes with all seven "normal" levels.
+Many bug fixes, making the Windows port (almost) stable.
+Huge code changes happened here.
0.4.4-0_PRG (b37a)
-Regression version from 0.5.2-0_PR (b37).
-Released to public. Including the complete level 4, and some levels of Level 5.
-Fixed two minor problems.
-
-0.3.2-0_PR (b27)
-Completing level 3.
-Avoid hidden bullets.
+Comes with four levels and some parts of the fifth level.
+Contains several bug fixes.
-0.2.9-2_PR (b22)
-Completing level 2.
-0.2.9-1_PR (b21) is released to public.
+0.2.9-1_PR (b21)
+First public prerelease version.
+Comes with two levels.
+Introduced multiplier system, not functional yet.
0.1.7-2_PR (b16)
Level 1 is finished.
diff --git a/VERSION b/VERSION
index 884cc8e..4ed675e 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.1-3 (r92) \ No newline at end of file
+0.9.1-4 (r93) \ No newline at end of file
diff --git a/global.h b/global.h
index ba9c161..fa91328 100644
--- a/global.h
+++ b/global.h
@@ -85,7 +85,7 @@ vector2d playerpos;
bool playerLockX,playerLockY;
bool DisableAllTower;
bool DisablePlayer;
-bool LOWFPS,diffkey,showalloc;
+bool LOWFPS,diffkey,showdebug;
int VidMode=-1;
hgeTTFont rbPanelFont;
inline double GetDist(vector2d,vector2d);
@@ -102,7 +102,7 @@ public:
//yelbrk serves as direction-change timer
//whicnt describes how much one will explode into (into an exactly circle)*/
double bulletspeed,bulletaccel,limv;
- bool exist,inv,addblend;
+ int exist,inv,addblend;
int whirem,whiskp,yelbrk;
int exp1,exp2;
double lifetime,rot;
@@ -341,7 +341,7 @@ static const char* archive[]={
};
#endif
//static const char* GLOBAL_H_FN="global.h";
-static const char* BLRVERSION="0.9.1-3 (r92)";
+static const char* BLRVERSION="0.9.1-4 (r93)";
static const char *months="JanFebMarAprMayJunJulAugSepOctNovDec";
char *parseDate(const char *date)
{
diff --git a/hgeft.h b/hgeft.h
index 4069db3..6856341 100644
--- a/hgeft.h
+++ b/hgeft.h
@@ -32,7 +32,7 @@
* Note: freetype 2.5.2 or newer is required.
* This library is somehow buggy, known bugs:
* * blinking charcter...
- * * segmentation fault(fixed now)
+ * * segmentation fault(fixed now,not a problem of the library)
* * Slow... but it's hard to improve...
* * Only support a single line...
*
diff --git a/levels.h b/levels.h
index 73c4c44..2ca2e66 100644
--- a/levels.h
+++ b/levels.h
@@ -3941,22 +3941,61 @@ void Levelm2Part17()
void Levelm2Part18()
{
frameleft=Infinity;
+ //Always clean up!
+ for(int i=0;i<200;++i)if(pinballs[i].Getlifetime()>5)pinballs[i].Kill();
tbrk-=hge->Timer_GetDelta();
if(tbrk<0)
{
tbrk=1.25-0.5*assetime/120.0f;if(tbrk<0.5)tbrk=0.5;
for(int i=0;i<200;++i)
- if(pinballs[i].Getlifetime()==0||pinballs[i].Getlifetime()>=10)
+ if(pinballs[i].Getlifetime()==0)
{
- int lay=3+5*assetime/120.0f;if(lay>8)lay=re.NextInt(3,10);
- vector2d pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500));
- while(GetDist(pos,playerpos)<100)pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500));
+ int lay=4+4*assetime/120.0f;if(lay>8)lay=9;
+ lay=re.NextInt(3,lay);
+ vector2d pos;
+ while(1)
+ {
+ pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500));
+ bool place=(GetDist(pos,playerpos)>=100);
+ for(int j=0;j<200;++j)
+ if(pinballs[j].Getlifetime()>0&&j!=i)
+ if(GetDist(pinballs[j].Position(),pos)<pinballs[j].Radius()+lay*10.0)
+ {place=false;break;}
+ if(place)break;
+ }
pinballs[i].Init(pos,lay);
break;
}
}
for(int i=0;i<200;++i)
- if(pinballs[i].Getlifetime()>0&&pinballs[i].Getlifetime()<10)pinballs[i].Update();
+ if(pinballs[i].Getlifetime()>0)
+ {
+ vector2d pos=pinballs[i].Position();
+ if(pos.x<pinballs[i].Radius()-5||pos.x>790-pinballs[i].Radius())
+ pinballs[i].Delta().x=-pinballs[i].Delta().x,++pinballs[i].Getlifetime(),pinballs[i].UpdateDelta();
+ if(pos.y<pinballs[i].Radius()-5||pos.y>590-pinballs[i].Radius())
+ pinballs[i].Delta().y=-pinballs[i].Delta().y,++pinballs[i].Getlifetime(),pinballs[i].UpdateDelta();
+ for(int j=i+1;j<200;++j)
+ if(pinballs[j].Getlifetime()>0&&pinballs[j].Getlifetime()<=5)
+ {
+ if(GetDist(pinballs[j].Position(),pinballs[i].Position())<pinballs[j].Radius()+pinballs[i].Radius())
+ {
+ double sqrdis=sqr(GetDist(pinballs[j].Position(),pinballs[i].Position()));
+ vector2d colline(pinballs[j].Position().x-pinballs[i].Position().x,
+ pinballs[j].Position().y-pinballs[i].Position().y);
+ double vp=pinballs[i].Delta()|colline;
+ double wp=pinballs[j].Delta()|colline;
+ vector2d ddelta((wp-vp)*colline.x/sqrdis,(wp-vp)*colline.y/sqrdis);
+ pinballs[i].Delta().x+=ddelta.x;pinballs[i].Delta().y+=ddelta.y;
+ pinballs[j].Delta().x-=ddelta.x;pinballs[j].Delta().y-=ddelta.y;
+ //prevent them to stick together...
+ vector2d stkprv=0.05*(pinballs[j].Radius()/sqrt(sqrdis)-1)*colline;
+ pinballs[j].Position()=pinballs[j].Position()-stkprv;
+ pinballs[i].UpdateDelta();pinballs[j].UpdateDelta();
+ }
+ }
+ pinballs[i].Update();
+ }
}
void Levelm2Part19()
{
diff --git a/main.cpp b/main.cpp
index eb47dc0..910a030 100644
--- a/main.cpp
+++ b/main.cpp
@@ -973,12 +973,13 @@ bool FrameFunc()
if (!LOWFPS&&infofade<0xFF)++infofade;
if (LOWFPS&&infofade<=0xEF)infofade+=16;
}
- if(hge->Input_GetKeyStateEx(HGEK_A)==HGEKST_HIT)showalloc^=1;
- if(showalloc)
+ if(hge->Input_GetKeyStateEx(HGEK_A)==HGEKST_HIT)showdebug^=1;
+ if(showdebug)
{
fnt->SetColor(0xFFFFFFFF);
fnt->printf(795, 0, HGETEXT_RIGHT, "Allocated bullets %d",bulcnt);
fnt->printf(795, 25, HGETEXT_RIGHT, "%d in use",bulinuse);
+ fnt->printf(795, 50, HGETEXT_RIGHT, "Player pos (%.2f,%.2f)",playerpos.x,playerpos.y);
}
fnt->SetColor(SETA(0xFFFFFF,infofade));
fnt->printf(5, 0, HGETEXT_LEFT, "Frames to go: %d",frameleft);
diff --git a/towernbullet.h b/towernbullet.h
index 6effdc4..e0998e8 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -2730,38 +2730,52 @@ class CPinBall
private:
int center;
int circles[10][30];
- int layer;double rot,lifetime,drt;
+ int layer,lifetime;double rot,drt;
+ vector2d delta;
public:
+ vector2d& Delta(){return delta;}
+ vector2d& Position(){return bullet[center].bulletpos;}
+ double Radius(){return layer*10.0-5;}
void Init(vector2d pos,int _lay)
{
- center=0;memset(circles,0,sizeof(circles));
- center=CreateBullet2(pos.x,pos.y,3,re.NextInt(-pi,pi),true);
- layer=_lay;rot=0;lifetime=0.01;drt=re.NextDouble(-0.5*pi,0.5*pi);
+ center=0;memset(circles,0,sizeof(circles));double speed=re.NextDouble(2,5);
+ center=CreateBullet2(pos.x,pos.y,speed,re.NextInt(-pi,pi),true);
+ delta=speed*bullet[center].bulletdir;
+ layer=_lay;rot=0;lifetime=1;drt=re.NextDouble(-0.5*pi,0.5*pi);
for(int i=0;i<layer;++i)
{
for(int j=0;j<(i+1)*3;++j)
{
- circles[i][j]=CreateBullet2(pos.x,pos.y,3,0,true);
+ circles[i][j]=CreateBullet2(pos.x,pos.y,0,0,true);
bullet[circles[i][j]].bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3)));
}
}
}
- double Getlifetime(){return lifetime;}
+ void Kill()
+ {
+ BulletEffect_Death(bullet[center],ColorToDWORD(blue));
+ bullet[center].exist=bullet[center].bullettype=0;
+ for(int i=0;i<layer;++i)
+ for(int j=0;j<(i+1)*3;++j)
+ {
+ BulletEffect_Death(bullet[circles[i][j]],ColorToDWORD(blue));
+ bullet[circles[i][j]].exist=bullet[circles[i][j]].bullettype=0;
+ }
+ lifetime=0;
+ }
+ int& Getlifetime(){return lifetime;}
+ void UpdateDelta()
+ {
+ vector2d tdt=ToUnitCircle(delta);
+ bullet[center].bulletdir=tdt;bullet[center].bulletspeed=delta.l();
+ }
void Update()
{
- lifetime+=hge->Timer_GetDelta();
vector2d pos=bullet[center].bulletpos;
- if(pos.x<10*layer-5||pos.x>790-10*layer)bullet[center].bulletdir.x=-bullet[center].bulletdir.x;
- if(pos.y<10*layer-5||pos.y>590-10*layer)bullet[center].bulletdir.y=-bullet[center].bulletdir.y;
rot+=hge->Timer_GetDelta()*drt;
for(int i=0;i<layer;++i)
- {
- for(int j=0;j<(i+1)*3;++j)
- {
- bullet[circles[i][j]].bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3)));
- bullet[circles[i][j]].bulletdir=bullet[center].bulletdir;
- }
- }
+ for(int j=0;j<(i+1)*3;++j)
+ bullet[circles[i][j]].bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3)));
}
};
class LineLaser:public Laser