aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCHANGELOG.TXT3
-rw-r--r--global.h2
-rw-r--r--levels.h110
-rw-r--r--main.cpp6
-rw-r--r--towernbullet.h12
5 files changed, 109 insertions, 24 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index 60aaad3..5a8db31 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -1,11 +1,12 @@
===================================================================
Next version:
-0.7.1-7_PR
+0.7.1-7_PR/0.7.2-0_PR
TODOs:
More new things?
Pre-Released versions:
0.7.1-6_PR (b69)
+Finish the new level.
Fusion bullet first work draft.
Fix some of the warnings from the compiler.
Adjust level difficulty. It was indeed too easy...
diff --git a/global.h b/global.h
index 5856889..632c881 100644
--- a/global.h
+++ b/global.h
@@ -89,7 +89,7 @@ struct Bullet
//whicnt describes how much one will explode into (into an exactly circle)*/
double bulletspeed;
double bulletaccel,limv;
- bool exist;
+ bool exist,inv;
int whirem,whiskp,yelbrk;
int exp1,exp2;
double lifetime;
diff --git a/levels.h b/levels.h
index 5196a27..9eb219d 100644
--- a/levels.h
+++ b/levels.h
@@ -1577,28 +1577,20 @@ void Level5Part20()
if (LOWFPS)ntrot+=16*pi/960.0f;else ntrot+=pi/960.0f;
if (ntbrk<0.01)return;
ntbrk=0;++ntcnt;if (ntcnt>15)ntcnt=0;
+ int a;if (ntcnt==0)
+ a=CreateBullet9(400+250*sin(ntrot),300+250*cos(ntrot),2,500,1,500);
+ else
+ a=CreateBullet9(400+250*sin(ntrot),300+250*cos(ntrot),2,999999999,1,999999999);
+ bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
+ bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
+ bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
if (ntcnt==0)
- {
- int a=CreateBullet9(400+250*sin(ntrot),300+250*cos(ntrot),2,500,1,500);
- bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
- bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
- bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
a=CreateBullet9(400+250*sin(ntrot+pi),300+250*cos(ntrot+pi),2,500,1,500);
- bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
- bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
- bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
- }
else
- {
- int a=CreateBullet9(400+250*sin(ntrot),300+250*cos(ntrot),2,999999999,1,999999999);
- bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
- bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
- bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
a=CreateBullet9(400+250*sin(ntrot+pi),300+250*cos(ntrot+pi),2,999999999,1,999999999);
- bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
- bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
- bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
- }
+ bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300));
+ bullet[a].bulletdir.x=-bullet[a].bulletdir.x;
+ bullet[a].bulletdir.y=-bullet[a].bulletdir.y;
}
void Level5Part21()
{
@@ -2627,6 +2619,7 @@ void Level7Part7()
}
}
}
+//Rearrange needed since here, see LEVELS.txt
BulletSine bnl[100];
double ykbrk;
void Level7Part8()//Photon school
@@ -2942,6 +2935,87 @@ void Level7Part18()//Great circles-child2
Circles[i].Update();
}
}
+double sntang;
+void Level7Part19()
+{
+ frameleft=AMinute;clrtime=2;towcnt=0;
+ DisableAllTower=false;
+ if (IfShowTip)
+ {
+ IfShowTip=false;
+ FadeTip=false;
+ Current_Position=2;
+ ShowTip("??????");
+ }
+ if (Current_Position==1)
+ {
+ ++part;All2pnt();avabrk=0.03f;avacurbrk=1.0f;sntang=-pi/2;
+ }
+}
+void L7P20Creator(double rl,double rr,double rad,TColors col,double speed,bool invi=false)
+{
+ double r=rand()%((int)(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;
+}
+void Level7Part20()
+{
+ //(600,600)->(250,600)
+ if (sntang>-pi)
+ {
+ avacurbrk+=hge->Timer_GetDelta();
+ if (avacurbrk>avabrk)
+ {
+ sntang-=pi/180;avacurbrk=0;
+ for(int i=0;i<6;++i)L7P20Creator(660,600,sntang,red,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(610,550,sntang,orange,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(560,500,sntang,yellow,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(510,450,sntang,green,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(460,410,sntang,blue,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(420,360,sntang,dblue,0,1);
+ for(int i=0;i<6;++i)L7P20Creator(365,310,sntang,purple,0,1);
+ }
+ }
+ else
+ {
+ avabrk=0.35+(frameleft/(double)AMinute)*0.4f;
+ avacurbrk+=hge->Timer_GetDelta();
+ if (avacurbrk>avabrk)
+ {
+ avacurbrk=0;
+ double spd=((AMinute-frameleft)/(double)AMinute)+1;
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(660,600,sntang,red,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(610,550,sntang,orange,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(560,500,sntang,yellow,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(510,450,sntang,green,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(460,410,sntang,blue,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(420,360,sntang,dblue,spd);
+ //======================
+ sntang=-pi+(rand()%(int)(pi/2*10000))/10000.0f;
+ for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i)
+ L7P20Creator(365,310,sntang,purple,spd);
+ sntang=-pi-0.1;
+ }
+ }
+}
//vvvvvvvvvvvvvvvvvvvvvv Old Levels vvvvvvvvvvvvvvvvvvvvvv//
/*void Level1Part2()//Simple tower8-discard
{
diff --git a/main.cpp b/main.cpp
index 8797df8..8ef33f6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -77,7 +77,7 @@ void Player_Clear_Expand()
for (int i=1;i<=bulcnt;++i)
{
double dis=GetDist(bullet[i].bulletpos,playerpos);
- if (dis<=clrrange&&bullet[i].exist)
+ if (dis<=clrrange&&bullet[i].exist&&!bullet[i].inv)
{
CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10);
bullet[i].exist=false;
@@ -100,7 +100,7 @@ void Player_Clear_Rotate()
double rad=atan2l(bullet[i].bulletpos.y-playerpos.y,bullet[i].bulletpos.x-playerpos.x);
hge->Gfx_RenderLine(playerpos.x+8,playerpos.y+8,playerpos.x+cos(clrrad)*clrmaxrange,playerpos.y+sin(clrrad)*clrmaxrange);
while (rad<0)rad+=2*pi;
- if (dis<=clrmaxrange&&bullet[i].exist&&rad>normalizerad(clrrad)-pi/12&&rad<normalizerad(clrrad)+pi/12)
+ if (dis<=clrmaxrange&&bullet[i].exist&&!bullet[i].inv&&rad>normalizerad(clrrad)-pi/12&&rad<normalizerad(clrrad)+pi/12)
{
CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10);
bullet[i].exist=false;
@@ -412,6 +412,8 @@ void CallLevels()
if (level==7&&part==16)Level7Part16();
if (level==7&&part==17)Level7Part17();
if (level==7&&part==18)Level7Part18();
+ if (level==7&&part==19)Level7Part19();
+ if (level==7&&part==20)Level7Part20();
/*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 ab0c2b6..52fbe38 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -46,6 +46,7 @@ int CreateBullet1(double x,double y,double bs,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=1;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -63,7 +64,7 @@ int CreateBullet1(double x,double y,double bs,bool eff=false)
if (eff)BulletEffect_Attatch(i);
return i;
}
-int CreateBullet2(double x,double y,double bs,double rad,bool eff=false)
+int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool invi=false)
{
++shots;
int i;
@@ -76,6 +77,7 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=invi;
bullet[i].bullettype=2;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -95,7 +97,7 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false)
}
void CreateBullet3(double x,double y,double bs,int dir,bool eff=false)
{
- CreateBullet2(x,y,bs,dir*0.5235987756,eff);
+ CreateBullet2(x,y,bs,dir*0.5235987756,eff,false);
}
void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false)
{
@@ -110,6 +112,7 @@ void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=4;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -140,6 +143,7 @@ void CreateBullet5(double x,double y,double bs,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=5;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -169,6 +173,7 @@ int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,b
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=6;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -203,6 +208,7 @@ int CreateBullet7(double x,double y,double bs,int explo,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=7;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -237,6 +243,7 @@ int CreateBullet8(double x,double y,double bs,bool eff=false)
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=8;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;
@@ -269,6 +276,7 @@ int CreateBullet9(double x,double y,double bs,int explo,int cnt,int brk,bool eff
if (i>bulcnt)bulcnt=i;
}
bullet[i].exist=true;
+ bullet[i].inv=false;
bullet[i].bullettype=9;
bullet[i].bulletpos.x=x;
bullet[i].bulletpos.y=y;