summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-11 03:37:24 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-11 03:37:24 +0000
commit285f4f3379a68db34eec86cdc5c8d6f3c5597f5e (patch)
tree477fd32c99b6132abf1754edfe6201c9c4af1976
parentdb6933143f3b9bb423faeaf823485672ec803000 (diff)
downloadbullet-lab-remix-285f4f3379a68db34eec86cdc5c8d6f3c5597f5e.tar.xz
Additive blending bullets, supernova level first draft.
-rwxr-xr-xCHANGELOG.TXT3
-rwxr-xr-xVERSION.TXT2
-rw-r--r--global.h15
-rw-r--r--levels.h57
-rw-r--r--main.cpp2
-rw-r--r--towernbullet.h5
6 files changed, 73 insertions, 11 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index a772610..9ceecdf 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -5,6 +5,9 @@ New levels...
Add missing tips.
Pre-Released versions:
+0.8.0-1_PR (b75)
+New level Supernova.
+
0.8.0-0_PR (b74)
New level Achromatopsia.
New level hyper-threading.
diff --git a/VERSION.TXT b/VERSION.TXT
index 2f082c4..a5a2d64 100755
--- a/VERSION.TXT
+++ b/VERSION.TXT
@@ -1 +1 @@
-0.8.0-0_PR (b74) \ No newline at end of file
+0.8.0-1_PR (b75) \ No newline at end of file
diff --git a/global.h b/global.h
index 01a9d12..07e54d8 100644
--- a/global.h
+++ b/global.h
@@ -74,20 +74,17 @@ inline double GetDist(vector2d,vector2d);
class Bullet
{
public:
- vector2d bulletpos;
- vector2d bulletdir;
+ vector2d bulletpos,bulletdir;
double dist;
- int bullettype;
- int redexplo,redattrib,oriexplo,whicnt;
+ int bullettype,redexplo,redattrib,oriexplo,whicnt;
DWORD sccolor;
/*In Orange bullets
//redattrib also serves as oraattrib to determine if they will explode or change direction
//redexplo also serves as orange explo
//yelbrk serves as direction-change timer
//whicnt describes how much one will explode into (into an exactly circle)*/
- double bulletspeed;
- double bulletaccel,limv;
- bool exist,inv;
+ double bulletspeed,bulletaccel,limv;
+ bool exist,inv,addblend;
int whirem,whiskp,yelbrk;
int exp1,exp2;
double lifetime,rot;
@@ -190,7 +187,7 @@ struct Target//An annoying circle
void TargFollowPlayer()
{
double curspd=0.01f;
- if (GetDist(playerpos,targpos)>1)curspd=0.02f;
+ if (GetDist(playerpos,targpos)>1)curspd=0.02f;else targpos=playerpos;
if (GetDist(playerpos,targpos)>2)curspd=0.1f;
if (GetDist(playerpos,targpos)>5)curspd=0.5f;
if (GetDist(playerpos,targpos)>10)curspd=0.75f;
@@ -212,7 +209,7 @@ struct Target//An annoying circle
void TargGoto(vector2d pos)
{
double curspd=0.01f;
- if (GetDist(pos,targpos)>1)curspd=0.02f;
+ if (GetDist(pos,targpos)>1)curspd=0.02f;else targpos=pos;
if (GetDist(pos,targpos)>2)curspd=0.1f;
if (GetDist(pos,targpos)>5)curspd=0.5f;
if (GetDist(pos,targpos)>10)curspd=0.75f;
diff --git a/levels.h b/levels.h
index 9955339..cb98b8e 100644
--- a/levels.h
+++ b/levels.h
@@ -3154,14 +3154,16 @@ support hyper-threading?");
CreateTower8(400,300,857,3,57,20,false);
for (int i=1;i<=towcnt;++i)
if (tower[i].RendColor==0x80FFFFFF)
+ {
+ aca.achroma2pnt();acb.achroma2pnt();
tower[i].RendColor=0x00FFFFFF;
+ }
for (int i=1;i<=towcnt;++i)
if ((tower[i].RendColor>>24)<=0x80)
tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
IfCallLevel=false;
- aca.achroma2pnt();acb.achroma2pnt();
playerpos=vector2d(200,150);PlayerSplit=true;
return;
}
@@ -3186,3 +3188,56 @@ void Levelm1Part12()
return;
}
}
+vector2d snextarg;
+int snexcnt,snexstep;
+Target snexTarg;
+void Levelm1Part13()//Additive blending
+{
+ frameleft=AMinute*2;
+ ++bgbrk;if (LOWFPS)bgbrk+=16;
+ if (bgbrk<30)return;
+ bgbrk=0;
+ if (!LOWFPS)
+ DBGColor=ColorTransfer(DBGColor,0xFF000000);
+ else
+ for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0xFF000000);
+ if (DBGColor==0xFF000000)
+ {
+ frameleft=AMinute,++part;
+ bgdbbrk=re.NextInt(5,20),bgbrk=0;
+ avabrk=2.0f;avacurbrk=0;snexTarg.Init(0.001,vector2d(400,300));
+ snexstep=0;snexcnt=10;snexTarg.TargShow();
+ }
+}
+void Levelm1Part14()
+{
+ snexTarg.TargRender();
+ avacurbrk+=hge->Timer_GetDelta();
+ switch (snexstep)
+ {
+ case 0:
+ if(avacurbrk>avabrk)snexstep=1,snextarg=playerpos;
+ break;
+ case 1:
+ snexTarg.TargGoto(snextarg);
+ if(GetDist(snexTarg.targpos,snextarg)<0.01)
+ {
+ snexstep=2;
+ avabrk=0;
+ avacurbrk=0.05;
+ snexcnt=100-(frameleft/(double)(AMinute*2))*50;
+ }
+ break;
+ case 2:
+ if(avacurbrk>avabrk)
+ {
+ if(--snexcnt>0)
+ {
+ avabrk=0;
+ bullet[CreateBullet2(snexTarg.targpos.x,snexTarg.targpos.y,2,re.NextDouble(-pi,pi),true)].addblend=true;
+ }
+ else snexstep=0,avabrk=2,avacurbrk=0;
+ }
+ break;
+ }
+}
diff --git a/main.cpp b/main.cpp
index c4e6a12..5f2c096 100644
--- a/main.cpp
+++ b/main.cpp
@@ -465,6 +465,8 @@ void CallLevels()
if (level==-1&&part==10)Levelm1Part10();
if (level==-1&&part==11)Levelm1Part11();
if (level==-1&&part==12)Levelm1Part12();
+ if (level==-1&&part==13)Levelm1Part13();
+ if (level==-1&&part==14)Levelm1Part14();
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;
diff --git a/towernbullet.h b/towernbullet.h
index 4c25f9d..8106dc8 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -66,6 +66,7 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool inv
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].addblend=false;
bullet[i].inv=invi;
bullet[i].bullettype=2;
bullet[i].bulletpos.x=x;
@@ -420,7 +421,11 @@ void ProcessBullet2(int i)
else
{
if(bullet[i].alterColor2==COLOR_COUNT)
+ {
+ if(bullet[i].addblend)bulletspr[bullet[i].alterColor]->SetBlendMode(0);
bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ if(bullet[i].addblend)bulletspr[bullet[i].alterColor]->SetBlendMode(2);
+ }
else
RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;