summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCHANGELOG.TXT3
-rw-r--r--background.h2
-rw-r--r--effects.h2
-rw-r--r--global.h2
-rw-r--r--levels.h17
-rw-r--r--libcgh.h2
-rw-r--r--libcghEx.cpp2
-rw-r--r--main.cpp65
-rw-r--r--menus.h2
-rw-r--r--music.h2
-rw-r--r--scorec.h2
-rw-r--r--scoresystem.h2
-rw-r--r--towernbullet.h250
13 files changed, 105 insertions, 248 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index e2b26ce..4bbc1b4 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -15,6 +15,9 @@ The real changelog is here:
New level "interference" (it's another small class "SimpleThing").
New background interface, use background pictures easily.
Minor code cleanups.
+Removed more useless comments, my code is still hard to comprehend,
+though.
+Don't copyleft, it's radical.
0.7.1-6_PR (b69)
Finish some new levels ("Great Circle" bring back & "rainbow
diff --git a/background.h b/background.h
index a2a6c17..f43e2f5 100644
--- a/background.h
+++ b/background.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Background drawing Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
const char* BACKGROUND_H_FN="background.h";
double deltaBG;
diff --git a/effects.h b/effects.h
index bfc13c0..27054b0 100644
--- a/effects.h
+++ b/effects.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Effects Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
#define NO_FREE 1
//static const char* EFFECTS_H_FN="effects.h";
diff --git a/global.h b/global.h
index a7a8ea8..fee13e3 100644
--- a/global.h
+++ b/global.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Global varibles and implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
#include <hge.h>
#include <hgefont.h>
#include <hgegui.h>
diff --git a/levels.h b/levels.h
index 773d0db..4ee02ec 100644
--- a/levels.h
+++ b/levels.h
@@ -1,22 +1,8 @@
//Chrisoft Bullet Lab Remix HGE
//Level Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
//Now this is being fully rewritten..
/*
-Planning Level Order:
-No Name Music Length Frozen?
-Level -1: Over the Horizon BLR2_TR08.ogg
-Level 1: Down by the Bank BLR2_TR01.ogg 3 Minutes F*
-Level 2: Pentagon Mystery BLR2_TR02.ogg 3.5 Minutes F*
-Level 3: Missing Colour BLR2_TR03.ogg 2.5 Minutes F*
-Level 4: Reunion BLR2_TR04.ogg 4.5 Minutes F*
-Level 5: Crazy Autumn BLR2_TR05.ogg 5+2/3 Min F*
-Level 6: Peaceful(?) Winter BLR2_TR06.ogg 6.5 Minutes F*
-Level 7: Rainbow of Spring BLR2_TR07.ogg
-Other Music:
-About Scene BLR2_TR09.ogg
-*/
-/*
How to write a classic level/part...
Classic parts need only one procedure, like this.
frameleft=...;
@@ -2373,7 +2359,6 @@ void Level7Part0()
Level 7-Rainbow of Spring\n\
Will there be a clearer day?\
");
- //IfCallLevel=false;
frameleft=TenSeconds;++part;
}
}
diff --git a/libcgh.h b/libcgh.h
index c428861..54c1209 100644
--- a/libcgh.h
+++ b/libcgh.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Chrisoft Game Helper header
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
//libcgh version 0003
//^Modify that when big change is made^
#include <hge.h>
diff --git a/libcghEx.cpp b/libcghEx.cpp
index 7ae9aa5..d228237 100644
--- a/libcghEx.cpp
+++ b/libcghEx.cpp
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Chrisoft Game Helper Extras implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
#include "libcgh.h"
#include <cmath>
#include <cstring>
diff --git a/main.cpp b/main.cpp
index d294780..ed50c7e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,6 +1,36 @@
//Chrisoft Bullet Lab Remix HGE
//Main Code
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
+//Now that we use BSD license, so let's paste it here.
+//(although it may be awful)
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of the nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
//#define Debug
#include <hge.h>
#include <hgefont.h>
@@ -416,32 +446,6 @@ void CallLevels()
if (level==7&&part==20)Level7Part20();
if (level==7&&part==21)Level7Part21();
if (level==7&&part==22)Level7Part22();
- /*if (level==1&&part==3)Level1Part3();
- if (level==1&&part==4)Level1Part4();
- if (level==1&&part==5)Level1Part5();
- if (level==1&&part==6)Level1Part6();
- if (level==1&&part==7)Level1Part7();
- if (level==1&&part==8)Level1Part8();
- if (level==1&&part==9)Level1Part9();
- if (level==1&&part==10)Level1Part10();
- if (level==1&&part==11)Level1Part11();
- if (level==1&&part==12)Level1Part12();
- if (level==1&&part==13)Level1Part13();
- if (level==1&&part==14)Level1Part14();
- if (level==1&&part==15)Level1Part15();
- if (level==1&&part==16)Level1Part16();
- if (level==1&&part==17)Level1Part17();
- if (level==1&&part==18)Level1Part18();
- if (level==1&&part==19)Level1Part19();
- if (level==1&&part==20)Level1Part20();
- if (level==1&&part==21)Level1Part21();
- if (level==1&&part==22)Level1Part22();
- if (level==1&&part==23)Level1Part23();
- if (level==1&&part==24)Level1Part24();
- if (level==1&&part==25)Level1Part25();
- if (level==1&&part==26)Level1Part26();
- if (level==1&&part==27)Level1Part27();
- if (level==1&&part==28)Level1Part28();*/
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;
@@ -597,17 +601,12 @@ bool FrameFunc()
}
for (int i=1;i<=nonamecnt;++i)if (noname[i].Exist())noname[i].Process();
ProcessPlayer();
- //SCEffect_Process();
RefreshScore();
{
if (ATarg.visible)ATarg.TargFollowPlayer(),ATarg.TargRender();
- //if (ATarg.isonshow)ATarg.TargShowProc();
- //if (ATarg.isonhide)ATarg.TargHideProc();
}
{
if (BTarg.visible)BTarg.TargRender();
- //if (BTarg.isonshow)BTarg.TargShowProc();
- //if (BTarg.isonhide)BTarg.TargHideProc();
}
if (!DisablePlayer)
--frameleft;//If we are at the tip scene, disable the player movement.
@@ -637,8 +636,6 @@ bool FrameFunc()
if (Current_Position==2)
{
ShowTip(lasttip);
- //if (Complete)
- // TipFont->printf(200,200,HGETEXT_LEFT,"Score");
}
if (Current_Position==4)AboutScene();
if (Current_Position==5)DeathGUI->Render();
diff --git a/menus.h b/menus.h
index 3d77eb3..50f96a1 100644
--- a/menus.h
+++ b/menus.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Menu Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
//[Perfect Freeze]: Code for menus won't change... until ...?
// --Announcement from Chirsno
//static const char* MENUS_H_FN="menus.h";
diff --git a/music.h b/music.h
index 4e48478..60e206a 100644
--- a/music.h
+++ b/music.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//In Game Music Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
HEFFECT Mus;
HCHANNEL Muc;
int lpst,lped;
diff --git a/scorec.h b/scorec.h
index 5b9e323..cc17f81 100644
--- a/scorec.h
+++ b/scorec.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Score Recording Implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
//static const char* SCOREC_H_FN="scorec.h";
struct TRecord
diff --git a/scoresystem.h b/scoresystem.h
index 3807e45..ba07d9e 100644
--- a/scoresystem.h
+++ b/scoresystem.h
@@ -1,6 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Multiplier implementations
-//"Copyleft" Chrisoft 2013
+//Copyright Chrisoft 2014
CircleIndicator MultTimer;
hgeFont *MultFnt;
hgeSprite *MB;
diff --git a/towernbullet.h b/towernbullet.h
index 83abca4..e8fdbd1 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -1,8 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Towers and Bullets Implementations
-//"Copyleft" Chrisoft 2013
-//WANTED:
-//Human-being who really knows what these mean, please contact Chirsno which is puzzled by these shitty codes..
+//Copyright Chrisoft 2014
//[Perfect Freeze]: code here for BLR2 won't change a lot since 30/08/2013
//Sorry that I would break that...
//I found the rendering code stupid so I MUST rewrite it RIGHT NOW.
@@ -56,11 +54,8 @@ int CreateBullet1(double x,double y,double bs,bool eff=false)
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
bullet[i].alterColor=green;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,48,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -86,13 +81,10 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool inv
bullet[i].bulletspeed=bs;
bullet[i].alterColor=blue;
bullet[i].lifetime=0;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,0,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].collable=true;
bullet[i].bulletaccel=bullet[i].limv=0;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -123,12 +115,9 @@ void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false)
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
bullet[i].yelbrk=yelbrk;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,192,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
bullet[i].alterColor=yellow;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
}
void CreateBullet5(double x,double y,double bs,bool eff=false)
@@ -154,11 +143,8 @@ void CreateBullet5(double x,double y,double bs,bool eff=false)
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
bullet[i].alterColor=purple;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,120,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
}
int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,bool eff=false)
@@ -188,11 +174,8 @@ int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,b
bullet[i].exp1=exp1;
bullet[i].exp2=exp2;
bullet[i].oriexplo=bullet[i].redexplo=explo;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,144,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -220,14 +203,11 @@ int CreateBullet7(double x,double y,double bs,int explo,bool eff=false)
bullet[i].bulletspeed=bs;
bullet[i].alterColor=white;
bullet[i].oriexplo=bullet[i].redexplo=explo;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,168,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].redattrib=0;
bullet[i].whirem=whicnt;
bullet[i].whiskp=0;
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -254,11 +234,8 @@ int CreateBullet8(double x,double y,double bs,bool eff=false)
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
bullet[i].alterColor=dblue;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,24,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -291,11 +268,8 @@ int CreateBullet9(double x,double y,double bs,int explo,int cnt,int brk,bool eff
bullet[i].whicnt=cnt;
bullet[i].yelbrk=brk;
bullet[i].alterColor=orange;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,72,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -319,8 +293,6 @@ void CreateBullet255(double x,double y,double bs)
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- //bullet[i].bulletspr=new hgeSprite(SprSheet,96,0,24,24);
- //bullet[i].bulletspr->SetColor(0x80FFFFFF);
}
void All2pnt()
{
@@ -336,24 +308,23 @@ void All2pnt()
}
void ProcessBullet1(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=1)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=1)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
bullet[i].exist=false;
@@ -364,29 +335,16 @@ void ProcessBullet1(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet2(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=2)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=2)return;
if (Current_Position==1)bullet[i].lifetime+=hge->Timer_GetDelta();
if (!DisablePlayer)
{
- /*if (LOWFPS)
- {
- if (bullet[i].bulletspeed<bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*17;
- //bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x)/20*17;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*17;//Process bullet's y coor.
- }
- else
- {
- if (bullet[i].bulletspeed<bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel;
- //bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20;//Process bullet's y coor.
- }*/
//experimental new coor processing code, FPS independent
if (bullet[i].bulletaccel>0&&bullet[i].bulletspeed<bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*(1000.0f/hge->Timer_GetFPS());
if (bullet[i].bulletaccel<0&&bullet[i].bulletspeed>bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*(1000.0f/hge->Timer_GetFPS());
@@ -394,7 +352,7 @@ void ProcessBullet2(int i)
bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*(1000.0f/hge->Timer_GetFPS());
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
{
bullet[i].exist=false;
@@ -405,7 +363,6 @@ void ProcessBullet2(int i)
return;
}
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
- //If collision is detected or the bullet flys out of screen, delete it.
{
++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;
if(!bullet[i].inv)
@@ -420,7 +377,6 @@ void ProcessBullet2(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
@@ -428,7 +384,7 @@ void ProcessBullet2(int i)
//There is no need for ProcessBullet3() because they are in fact bullet2
void ProcessBullet4(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=4)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=4)return;
if (!DisablePlayer)
{
if (LOWFPS)
@@ -445,21 +401,18 @@ void ProcessBullet4(int i)
}
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
- //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
bullet[i].exist=false;
@@ -470,33 +423,29 @@ void ProcessBullet4(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet5(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=5)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=5)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
- //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)playerspeed*=0.9,playerslospeed*=0.9;
bullet[i].exist=false;
@@ -507,27 +456,24 @@ void ProcessBullet5(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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);
}
}
void ProcessBullet6(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=6)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=6)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
- //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
}
if (!LOWFPS)
{
@@ -550,7 +496,6 @@ void ProcessBullet6(int i)
for (int j=1;j<=bullet[i].exp1;++j)
{
int pnt=CreateBullet6(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,bullet[i].oriexplo,bullet[i].exp1,bullet[i].exp2,bullet[i].scale>1.5?true:false);
- //hge->Effect_PlayEx(snd,100,(bullet[i].bulletpos.x-400)/4);
bullet[pnt].setdir(2*pi/(double)bullet[i].exp1*j);
bullet[pnt].redattrib=1;
}
@@ -569,9 +514,8 @@ void ProcessBullet6(int i)
bullet[i].bullettype=0;
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
bullet[i].exist=false;
@@ -582,28 +526,25 @@ void ProcessBullet6(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet7(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=7)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=7)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
- //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
}
if (!LOWFPS)
{
@@ -624,7 +565,7 @@ void ProcessBullet7(int i)
if (bullet[i].redattrib==0)
{
int pnt=CreateBullet7(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,bullet[i].oriexplo,bullet[i].scale>1.5?true:false);
- //hge->Effect_PlayEx(snd,100,(bullet[i].bulletpos.x-400)/4);
+
bullet[pnt].bulletdir.x=0;
bullet[pnt].bulletdir.y=0;
bullet[pnt].dist=1;
@@ -675,9 +616,8 @@ void ProcessBullet7(int i)
}
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
bullet[i].exist=false;
@@ -688,31 +628,29 @@ void ProcessBullet7(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet8(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=8)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=8)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
else
@@ -729,20 +667,19 @@ void ProcessBullet8(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet9(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=9)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=9)return;
if (!DisablePlayer)
{
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
if (bullet[i].redattrib==0)
{
bullet[i].redexplo-=17;
@@ -773,8 +710,8 @@ void ProcessBullet9(int i)
}
else
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
if (bullet[i].redattrib==0)
{
--bullet[i].redexplo;
@@ -805,9 +742,8 @@ void ProcessBullet9(int i)
}
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
bullet[i].exist=false;
@@ -818,14 +754,13 @@ void ProcessBullet9(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,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 (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
}
}
void ProcessBullet255(int i)
{
- if (!bullet[i].exist||bullet[i].bullettype!=255)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=255)return;
if (!DisablePlayer)
{
bullet[i].bulletspeed=10;
@@ -835,20 +770,17 @@ void ProcessBullet255(int i)
bullet[i].dist=sqrt(bullet[i].dist);
if (LOWFPS)
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;
}
else
{
- bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
+ bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;
+ bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;
}
- //bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20;//Process bullet's x coor.
- //bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
}
- double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
- //If collision is detected or the bullet flys out of screen, delete it.
{
bullet[i].exist=false;
bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
@@ -861,12 +793,11 @@ void ProcessBullet255(int i)
}
else
{
- //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x,bullet[i].bulletpos.y,0,0.5,0);
bulletspr[grey]->SetColor(0x80FFFFFF);
bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+6,bullet[i].bulletpos.y+6,0,0.5,0);
}
}
-int CreateTower1(double x,double y,int timer,double bs,double offset=0,bool eff=false)//This returns the created tower number.
+int CreateTower1(double x,double y,int timer,double bs,double offset=0,bool eff=false)
{
int i;
if (towcnt==0)
@@ -889,15 +820,12 @@ int CreateTower1(double x,double y,int timer,double bs,double offset=0,bool eff=
tower[i].bulletspeed=bs;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,136,44,44);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
tower[i].offset=offset;
- //tower[i].towerspr->SetHotSpot(22,22);
return i;
}
-int CreateTower2(double x,double y,int timer,double bs,bool eff=false)//This returns the created tower number.
+int CreateTower2(double x,double y,int timer,double bs,bool eff=false)
{
int i;
if (towcnt==0)
@@ -917,14 +845,11 @@ int CreateTower2(double x,double y,int timer,double bs,bool eff=false)//This ret
tower[i].bulletspeed=bs;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,48,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
return i;
}
-int CreateTower3(double x,double y,int timer,double bs,int t3t,bool eff=false)//This returns the created tower number.
+int CreateTower3(double x,double y,int timer,double bs,int t3t,bool eff=false)
{
int i;
if (towcnt==0)
@@ -945,14 +870,11 @@ int CreateTower3(double x,double y,int timer,double bs,int t3t,bool eff=false)//
tower[i].t3t=t3t;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,48,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
return i;
}
-int CreateTower3_fixeddir(double x,double y,int timer,double bs,double rad,bool eff=false)//This returns the created tower number.
+int CreateTower3_fixeddir(double x,double y,int timer,double bs,double rad,bool eff=false)
{
int i;
if (towcnt==0)
@@ -973,14 +895,11 @@ int CreateTower3_fixeddir(double x,double y,int timer,double bs,double rad,bool
tower[i].offset=rad;tower[i].t3t=999;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,48,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
return i;
}
-int CreateTower4(double x,double y,int timer,double bs,int yelbrk=0,bool eff=false)//This returns the created tower number.
+int CreateTower4(double x,double y,int timer,double bs,int yelbrk=0,bool eff=false)
{
int i;
if (towcnt==0)
@@ -1003,15 +922,12 @@ int CreateTower4(double x,double y,int timer,double bs,int yelbrk=0,bool eff=fal
tower[i].bulletspeed=bs;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,180,24,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].yelbrk=yelbrk;
tower[i].effect=eff;
return i;
}
-int CreateTower5(double x,double y,int timer,double bs,bool eff=false)//This returns the created tower number.
+int CreateTower5(double x,double y,int timer,double bs,bool eff=false)
{
int i;
if (towcnt==0)
@@ -1034,14 +950,11 @@ int CreateTower5(double x,double y,int timer,double bs,bool eff=false)//This ret
tower[i].bulletspeed=bs;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,48,24,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
return i;
}
-int CreateTower6(double x,double y,int timer,double bs,int redexplo,int exp1=8,int exp2=12,bool eff=false)//This returns the created tower number.
+int CreateTower6(double x,double y,int timer,double bs,int redexplo,int exp1=8,int exp2=12,bool eff=false)
{
int i;
if (towcnt==0)
@@ -1066,14 +979,11 @@ int CreateTower6(double x,double y,int timer,double bs,int redexplo,int exp1=8,i
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
tower[i].exp1=exp1;tower[i].exp2=exp2;
- //tower[i].towerspr=new hgeSprite(SprSheet,92,24,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
return i;
}
-int CreateTower7(double x,double y,int timer,double bs,int redexplo,bool eff=false)//This returns the created tower number.
+int CreateTower7(double x,double y,int timer,double bs,int redexplo,bool eff=false)
{
int i;
if (towcnt==0)
@@ -1097,9 +1007,6 @@ int CreateTower7(double x,double y,int timer,double bs,int redexplo,bool eff=fal
tower[i].redexplo=redexplo;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,136,24,44,44);
- //tower[i].towerspr->SetHotSpot(22,22);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].whicnt=whicnt;
tower[i].effect=eff;
@@ -1131,11 +1038,8 @@ int CreateTower8(double x,double y,int timer,double bs,int timer2,int scnt,bool
tower[i].shotcount=tower[i].curshotcount=scnt;
tower[i].dblstate=false;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,92,44,44);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
- //tower[i].towerspr->SetHotSpot(22,22);
return i;
}
int CreateTower9(double x,double y,int timer,double bs,int explo,int cnt,int brk,bool eff=false)
@@ -1164,11 +1068,8 @@ int CreateTower9(double x,double y,int timer,double bs,int explo,int cnt,int brk
tower[i].yelbrk=brk;
tower[i].towertimer=tower[i].curtimer=timer;
tower[i].towerpos.x=x,tower[i].towerpos.y=y;
- //tower[i].towerspr=new hgeSprite(SprSheet,0,180,44,44);
- //tower[i].towerspr->SetColor(0x80FFFFFF);
tower[i].RendColor=0x80FFFFFF;
tower[i].effect=eff;
- //tower[i].towerspr->SetHotSpot(22,22);
return i;
}
void ProcessTower1()
@@ -1176,7 +1077,6 @@ void ProcessTower1()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=1)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[green]->SetColor(tower[i].RendColor);
towerspr[green]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1202,7 +1102,6 @@ void ProcessTower2()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=2)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[blue]->SetColor(tower[i].RendColor);
towerspr[blue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1225,7 +1124,6 @@ void ProcessTower3()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=3)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[blue]->SetColor(tower[i].RendColor);
towerspr[blue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1288,7 +1186,6 @@ void ProcessTower4()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=4)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[yellow]->SetColor(tower[i].RendColor);
towerspr[yellow]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1308,7 +1205,6 @@ void ProcessTower5()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=5)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[purple]->SetColor(tower[i].RendColor);
towerspr[purple]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1328,7 +1224,6 @@ void ProcessTower6()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=6)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[red]->SetColor(tower[i].RendColor);
towerspr[red]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1348,7 +1243,6 @@ void ProcessTower7()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=7)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[white]->SetColor(tower[i].RendColor);
towerspr[white]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1368,7 +1262,6 @@ void ProcessTower8()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=8)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[dblue]->SetColor(tower[i].RendColor);
towerspr[dblue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1429,7 +1322,6 @@ void ProcessTower9()
for (int i=1;i<=towcnt;++i)
{
if (!tower[i].exist||tower[i].towertype!=9)continue;
- //tower[i].towerspr->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
towerspr[orange]->SetColor(tower[i].RendColor);
towerspr[orange]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545);
if (DisableAllTower)continue;
@@ -1441,7 +1333,6 @@ void ProcessTower9()
{
tower[i].curtimer=tower[i].towertimer;
CreateBullet9(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].redexplo,tower[i].whicnt,tower[i].yelbrk,tower[i].effect);
- //hge->Effect_PlayEx(snd,100,(tower[i].towerpos.x-400)/4);
}
}
}
@@ -1592,39 +1483,21 @@ void CreateBullet2(Bullet &Tar,double x,double y,double bs,double rad,bool eff=f
Tar.scale=1;
Tar.scollable=true;
Tar.bulletaccel=0;
- //Tar.bulletspr=new hgeSprite(SprSheet,0,0,24,24);
- //Tar.bulletspr->SetColor(0x80FFFFFF);
- //Tar.bulletspr->SetHotSpot(12,12);
}
void ProcessBullet2(Bullet &xbul,bool colchk=true)
{
if (xbul.bulletspeed<xbul.limv)xbul.bulletspeed+=xbul.bulletaccel;
- if (!xbul.exist||xbul.bullettype!=2)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!xbul.exist||xbul.bullettype!=2)return;
if (!xbul.dist)xbul.dist=1;
- /*if (LOWFPS)
- xbul.bulletpos.x-=xbul.bulletspeed*(xbul.bulletdir.x/xbul.dist)/20*17,//Process bullet's x coor.
- xbul.bulletpos.y-=xbul.bulletspeed*(xbul.bulletdir.y/xbul.dist)/20*17;//Process bullet's y coor.
- else
- xbul.bulletpos.x-=xbul.bulletspeed*(xbul.bulletdir.x/xbul.dist)/20,//Process bullet's x coor.
- xbul.bulletpos.y-=xbul.bulletspeed*(xbul.bulletdir.y/xbul.dist)/20;//Process bullet's y coor.*/
xbul.bulletpos.x-=xbul.bulletspeed*(xbul.bulletdir.x/xbul.dist)/20*(1000.0f/hge->Timer_GetFPS());
xbul.bulletpos.y-=xbul.bulletspeed*(xbul.bulletdir.y/xbul.dist)/20*(1000.0f/hge->Timer_GetFPS());
double dis=GetDist(xbul.bulletpos,playerpos);
- /*if (xbul.bulletpos.x<=-100||xbul.bulletpos.x>=900||xbul.bulletpos.y<=-100||xbul.bulletpos.y>=700)
- {
- xbul.exist=false;
- xbul.bulletpos.x=xbul.bulletpos.y=0;
- xbul.bulletdir.x=xbul.bulletdir.y=0;
- xbul.bullettype=0;
- }*/
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&colchk)
- //If collision is detected or the bullet flys out of screen, delete it.
{
++coll,scminus+=10000,Mult_BatClear();
return;
}
if (dis<=16&&xbul.scollable)++semicoll,++dsmc,xbul.scollable=false,SCEffect_Attatch();
- //xbul.bulletspr->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.5);
if (colchk)bulletspr[xbul.alterColor]->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.6*xbul.scale);
}
//"Noname"
@@ -1771,7 +1644,6 @@ struct SimpleBullet
else RenderAlter(vector2d(bulletpos.x+7.2,bulletpos.y+7.2),aC,aC2,rot,0.6);
double dis=GetDist(bulletpos,playerpos);
if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&!lastcoll)
- //If collision is detected or the bullet flys out of screen, delete it.
{
++coll,scminus+=10000;lastcoll=1;Mult_BatClear();
return true;//Collision