aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-02-03 03:16:50 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-02-03 03:16:50 +0000
commitaa24dc151df4249483f9c46e0f11e47296a0e42a (patch)
tree1bf42c909ebffe4c604a67d905abf77e6be24b5c
parenteb7cde2a10895da166cebe13452ca3b284eab78c (diff)
downloadbullet-lab-remix-aa24dc151df4249483f9c46e0f11e47296a0e42a.tar.xz
M trunk/CHANGELOG.TXT
M trunk/VERSION.TXT M trunk/effects.h M trunk/global.h M trunk/levels.h M trunk/main.cpp M trunk/towernbullet.h
-rwxr-xr-xCHANGELOG.TXT9
-rwxr-xr-xVERSION.TXT2
-rw-r--r--effects.h15
-rw-r--r--global.h57
-rw-r--r--levels.h100
-rw-r--r--main.cpp19
-rw-r--r--towernbullet.h252
7 files changed, 262 insertions, 192 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index 3ed741a..ddab0f9 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -1,10 +1,13 @@
=================================================================
Next version:
-0.7.0-8_PR (b61)
-Improve the rendering code. (That code was a great fucking
-resource consumer)
+Maybe 0.7.0-9_PR?..
Pre-Released versions:
+0.7.0-8_PR (b61)
+Improved the rendering code. More tests are required...
+--Okay it's now tested. Another bug in FPS independent bullets
+fixed. No bugs found in the new rendering code.
+
0.7.0-7_PR (b60)
Spring Festival commit...
One level is rewritten.
diff --git a/VERSION.TXT b/VERSION.TXT
index 6ad3e29..35d2849 100755
--- a/VERSION.TXT
+++ b/VERSION.TXT
@@ -1 +1 @@
-0.7.0-7_PR (b60) \ No newline at end of file
+0.7.0-8_PR (b61) \ No newline at end of file
diff --git a/effects.h b/effects.h
index 3c11cb5..0443754 100644
--- a/effects.h
+++ b/effects.h
@@ -27,8 +27,9 @@ void SCEffect_Attatch()
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=rand()%4+2;
- bullet[i].bulletspr=new hgeSprite(SprSheet,96,0,24,24);
- bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ //bullet[i].bulletspr=new hgeSprite(SprSheet,96,0,24,24);
+ //bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ bullet[i].sccolor=0x80FFFFFF;
}
}
void SCEffect_Process()
@@ -44,7 +45,7 @@ void SCEffect_Process()
bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17;//Process bullet's y coor.
++effskp;
if (effskp==7)
- bullet[i].bulletspr->SetColor(bullet[i].bulletspr->GetColor()-0x1F000000),effskp=0;
+ bullet[i].sccolor=bullet[i].sccolor-0x1F000000,effskp=0;
}
else
{
@@ -52,13 +53,13 @@ void SCEffect_Process()
bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20;//Process bullet's y coor.
++effskp;
if (effskp==7)
- bullet[i].bulletspr->SetColor(bullet[i].bulletspr->GetColor()-0x1000000),effskp=0;
+ bullet[i].sccolor=bullet[i].sccolor-0x1000000,effskp=0;
}
//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
- if (GETA(bullet[i].bulletspr->GetColor())<=0x0A||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
+ if (GETA(bullet[i].sccolor)<=0x0A||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;
@@ -72,7 +73,9 @@ void SCEffect_Process()
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+2,bullet[i].bulletpos.y+2,0,0.2,0);
+ //bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+2.4,bullet[i].bulletpos.y+2.4,0,0.2,0);
+ bulletspr[grey]->SetColor(bullet[i].sccolor);
+ bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+2.4,bullet[i].bulletpos.y+2.4,0,0.2,0);
}
}
diff --git a/global.h b/global.h
index fb8ea32..301a855 100644
--- a/global.h
+++ b/global.h
@@ -62,6 +62,9 @@ Multiplier"+1" 0,272,48,48
Text:blnsns.png
"Multiplier bonus!" 0,235,163,21
*/
+enum TColors
+{green=0,blue,yellow,purple,red,white,dblue,orange,grey,COLOR_COUNT};
+hgeSprite *bulletspr[COLOR_COUNT],*towerspr[COLOR_COUNT];
const double zero=1e-5;
vector2d playerpos;
bool playerLockX,playerLockY;
@@ -71,12 +74,13 @@ bool LOWFPS=false,diffkey=false;
inline double GetDist(vector2d,vector2d);
struct Bullet
{
- hgeSprite *bulletspr;//This shit will be deprecated.
+ //hgeSprite *bulletspr;//This shit will be deprecated.
vector2d bulletpos;
vector2d bulletdir;
double dist;
int bullettype;
int 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
@@ -90,6 +94,7 @@ struct Bullet
int lifetime;
bool scollable;
double scale;int effbrk;
+ TColors alterColor;
void redir(vector2d targ)
{
bulletdir.x=bulletpos.x-targ.x;
@@ -119,7 +124,7 @@ struct Bullet
//255: Score point*/
struct Tower
{
- hgeSprite *towerspr;//So will this one.
+ //hgeSprite *towerspr;//So will this one.
vector2d towerpos;
int towertype;
int towertimer,curtimer;
@@ -132,6 +137,7 @@ struct Tower
int t3t;
bool exist,effect;
double offset;
+ DWORD RendColor;
}tower[100];
//t3t is for Tower3
//0:All 12 directions
@@ -364,6 +370,7 @@ void ShowTip(char *tip)
TipFont->SetColor(TipFont->GetColor()+0x08000000);
}
}
+void All2pnt();//forward that...
void ClearAll(bool cbullet=true)
{
DisableAllTower=true;
@@ -373,17 +380,17 @@ void ClearAll(bool cbullet=true)
if (!tower[i].exist)continue;
if (LOWFPS)
{
- if (tower[i].towerspr->GetColor()>>24>=0x08)
+ if (tower[i].RendColor>>24>=0x08)
{
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()-0x8000000);
+ tower[i].RendColor=tower[i].RendColor-0x8000000;
none=false;
}
}
else
{
- if (tower[i].towerspr->GetColor()>>24>=0x01)
+ if (tower[i].RendColor>>24>=0x01)
{
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()-0x1000000);
+ tower[i].RendColor=tower[i].RendColor-0x1000000;
none=false;
}
}
@@ -392,8 +399,9 @@ void ClearAll(bool cbullet=true)
{
towcnt=0;
memset(tower,0,sizeof(tower));
+ if (cbullet)All2pnt();
}
- if (cbullet)
+ /*if (cbullet)
{
none=true;
for (int i=1;i<=bulcnt;++i)
@@ -424,7 +432,7 @@ void ClearAll(bool cbullet=true)
for (int i=1;i<=bulcnt;++i)if (bullet[i].bulletspr->GetColor()>>24>=0x3F){none=false;break;}
if (none)
bulcnt=0,memset(bullet,0,sizeof(bullet));
- }
+ }*/
}
void SaySomethingAndBye(char *text)
{
@@ -463,3 +471,36 @@ DWORD ColTrans(DWORD src,DWORD dsr,DWORD speed)
}
return ARGB(0xFF,sr,sg,sb);
}
+TextureRect GetTextureRect(int type,TColors color)
+{
+ if (type==0)
+ {
+ switch(color)
+ {
+ case green:return TextureRect(48,0,24,24);
+ case blue:return TextureRect(0,0,24,24);
+ case yellow:return TextureRect(192,0,24,24);
+ case purple:return TextureRect(120,0,24,24);
+ case red:return TextureRect(144,0,24,24);
+ case white:return TextureRect(168,0,24,24);
+ case dblue:return TextureRect(24,0,24,24);
+ case orange:return TextureRect(72,0,24,24);
+ case grey:return TextureRect(96,0,24,24);
+ }
+ }
+ if (type==1)
+ {
+ switch(color)
+ {
+ case green:return TextureRect(0,136,44,44);
+ case blue:return TextureRect(0,48,44,44);
+ case yellow:return TextureRect(180,24,44,44);
+ case purple:return TextureRect(48,24,44,44);
+ case red:return TextureRect(92,24,44,44);
+ case white:return TextureRect(136,24,44,44);
+ case dblue:return TextureRect(0,92,44,44);
+ case orange:return TextureRect(0,180,44,44);
+ }
+ }
+ return TextureRect(0,0,0,0);
+}
diff --git a/levels.h b/levels.h
index 17de738..26dcd63 100644
--- a/levels.h
+++ b/levels.h
@@ -65,7 +65,7 @@ void Level1Part1()
{
//Level procedure
//Simple Level procedures should only run once during a level
- if ((tower[CreateTower1(400,300,857,2)].towerspr->GetColor()>>24)>=0x80)IfCallLevel=false;
+ if ((tower[CreateTower1(400,300,857,2)].RendColor>>24)>=0x80)IfCallLevel=false;
//Current_Position=2;
frameleft=AMinute*2;
tcnt=1;sout=false;dscroll=-0.025f;memset(dmt,true,sizeof(dmt));
@@ -148,11 +148,11 @@ void Level1Part3()
CreateTower3(772,i*24-24,1714,2,2),
CreateTower3(28,i*24-12,1714,2,2);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
++part;
@@ -415,14 +415,14 @@ void Level3Part1()
//Create your towers
CreateTower8(400,300,857,3,57,30,false);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
- IfCallLevel=false;
+ ++part;
return;
}
}
@@ -450,14 +450,14 @@ void Level3Part2()
CreateTower8(30,556,1250,3,57,15,false);
CreateTower8(746,556,1250,3,57,15,false);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
- IfCallLevel=false;
+ ++part;
return;
}
}
@@ -478,8 +478,8 @@ public:
void init()
{
stage=0;rad1=rad2=srad;elasp=0.0f;ccnt=0;
- for (int i=0;i<cnt;++i)Bul[i]=&bullet[CreateBullet8(400,300,0,false)],DirectBullet(*Bul[i],srad),Bul[i]->bulletspr->SetColor(0x00FFFFFF);
- Bul[0]->bulletspeed=2;Bul[0]->bulletspr->SetColor(0x80FFFFFF);
+ for (int i=0;i<cnt;++i)Bul[i]=&bullet[CreateBullet8(400,300,0,false)],DirectBullet(*Bul[i],srad),Bul[i]->scale=0.01;
+ Bul[0]->bulletspeed=2;Bul[0]->scale=1;
}
void stage0()
{
@@ -488,7 +488,7 @@ public:
{
ccnt=(int)(elasp/0.2f);
if (ccnt==1)dtrange=GetDist(Bul[0]->bulletpos,Bul[1]->bulletpos);
- Bul[ccnt]->bulletspeed=2;Bul[ccnt]->bulletspr->SetColor(0x80FFFFFF);
+ Bul[ccnt]->bulletspeed=2;Bul[ccnt]->scale=1;
}
if (elasp>2)
{
@@ -555,11 +555,11 @@ void Level3Part3()
//Create your towers
CreateTower8(400,300,999999999,0,999999999,0,false);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
for (int k=0;k<6;++k)
@@ -669,11 +669,11 @@ void Level4Part1()
//Create your towers
CreateTower9(400,300,1000,4,750,36,750);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
IfCallLevel=false;
@@ -1115,11 +1115,11 @@ void Level4Part24()
CreateTower1(9,567,2000,3);
CreateTower1(767,567,2000,3);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
++part;
@@ -1168,11 +1168,11 @@ void Level5Part1()
CreateTower9(400,300,2000,3,1000,36,750);
CreateTower4(400,50,2000,2.5,0);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
IfCallLevel=false;
@@ -1329,11 +1329,11 @@ void Level5Part7()
//Create your towers
for (int i=1;i<=33;++i)CreateTower8(i*24-12,12,500,10,20,30);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
++part;All2pnt();
@@ -1368,11 +1368,11 @@ void Level5Part9()
//Create your towers
for (int i=1;i<=33;++i)CreateTower8(i*24-12,12,750,1,1,1),CreateTower8(i*24-12,588,750,1,1,1);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
++part;All2pnt();
@@ -1385,7 +1385,8 @@ void Level5Part10()
if (tbrk<=3)return;
tbrk=0;
int p=CreateBullet1(playerpos.x,12,2);
- bullet[p].bulletspr->SetTextureRect(72,0,24,24);
+ //bullet[p].bulletspr->SetTextureRect(72,0,24,24);
+ bullet[p].alterColor=orange;
}
void Level5Part11()
{
@@ -1652,11 +1653,11 @@ void Level6Part1()
whicnt=10;
CreateTower7(400,300,750,3,500);
for (int i=1;i<=towcnt;++i)
- if (tower[i].towerspr->GetColor()==0x80FFFFFF)
- tower[i].towerspr->SetColor(0x00FFFFFF);
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
for (int i=1;i<=towcnt;++i)
- if ((tower[i].towerspr->GetColor()>>24)<=0x80)
- tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF);
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
else
{
IfCallLevel=false;
@@ -2358,7 +2359,8 @@ void Level6Part999999999()//well this isnot an easter egg!
for (int i=1;i<=rand()%10;++i)
{
int pnt=CreateBullet2(rand()%780+10,590,1,pi/2);
- bullet[pnt].bulletspr->SetTextureRect(168,0,24,24);
+ bullet[pnt].alterColor=white;
+ //!!TODO: Restore this later
}
}
}
@@ -2549,7 +2551,7 @@ void Level7Part4()
}
}
}
-BulletSine bnl[100];//Yukari...
+BulletSine bnl[100];
double ykbrk;
void Level7Part5()//This should be another part.
{
diff --git a/main.cpp b/main.cpp
index 459f060..81a9d55 100644
--- a/main.cpp
+++ b/main.cpp
@@ -805,6 +805,20 @@ int main()
TipFont=new hgeFont("./Resources/charmap.fnt");
MultFnt=new hgeFont("./Resources/charmap.fnt");
spr=new hgeSprite(SprSheet,216,0,24,24);
+ for (int ii=0;ii<COLOR_COUNT;++ii)
+ {
+ TColors i=(TColors)ii;
+ TextureRect a=GetTextureRect(0,i);
+ bulletspr[i]=new hgeSprite(SprSheet,a.x,a.y,a.w,a.h);
+ bulletspr[i]->SetHotSpot(12,12);bulletspr[i]->SetColor(0x80FFFFFF);
+ }
+ for (int ii=0;ii<grey;++ii)
+ {
+ TColors i=(TColors)ii;
+ TextureRect a=GetTextureRect(1,i);
+ towerspr[i]=new hgeSprite(SprSheet,a.x,a.y,a.w,a.h);
+ towerspr[i]->SetHotSpot(22,22);bulletspr[i]->SetColor(0x80FFFFFF);
+ }
gui=new hgeGUI();
gui->AddCtrl(new hgeGUIMenuItem(1,fnt,snd,400,200,0.0f,"Start"));
gui->AddCtrl(new hgeGUIMenuItem(2,fnt,snd,400,240,0.1f,"Highscores && Records"));
@@ -818,10 +832,9 @@ int main()
if (LOWFPS)
hge->System_Log("%s: Low FPS Mode Enabled.\n",MAIN_SRC_FN);
hge->System_Start();
- delete gui;
- delete fnt;
+ delete gui;delete titlespr;
+ delete fnt;delete playerspr;
delete spr;
- //hge->Effect_Free(snd);
hge->Texture_Free(tex);
hge->Texture_Free(quad.tex);
}
diff --git a/towernbullet.h b/towernbullet.h
index b13bf1b..42e84c8 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -37,11 +37,12 @@ int CreateBullet1(double x,double y,double bs,bool eff=false)
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,48,0,24,24);
- bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ 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);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -64,13 +65,14 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false)
bullet[i].bulletdir.x=cos(rad);
bullet[i].bulletdir.y=sin(rad);
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].bulletspr=new hgeSprite(SprSheet,0,0,24,24);
+ //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].bulletaccel=bullet[i].limv=0;
bullet[i].scale=1;
- bullet[i].bulletspr->SetHotSpot(12,12);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -100,11 +102,12 @@ 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].bulletspr=new hgeSprite(SprSheet,192,0,24,24);
+ //bullet[i].bulletspr->SetColor(0x80FFFFFF);
bullet[i].scollable=true;
bullet[i].scale=1;
- bullet[i].bulletspr->SetHotSpot(12,12);
+ 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)
@@ -128,11 +131,12 @@ void CreateBullet5(double x,double y,double bs,bool eff=false)
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,120,0,24,24);
- bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ 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);
+ //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)
@@ -156,15 +160,16 @@ int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,b
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].alterColor=red;
bullet[i].redattrib=0;
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].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);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -189,15 +194,16 @@ int CreateBullet7(double x,double y,double bs,int explo,bool eff=false)
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].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].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);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -222,11 +228,12 @@ int CreateBullet8(double x,double y,double bs,bool eff=false)
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,24,0,24,24);
- bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ 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);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -257,11 +264,12 @@ int CreateBullet9(double x,double y,double bs,int explo,int cnt,int brk,bool eff
bullet[i].redattrib=0;
bullet[i].whicnt=cnt;
bullet[i].yelbrk=brk;
- bullet[i].bulletspr=new hgeSprite(SprSheet,72,0,24,24);
- bullet[i].bulletspr->SetColor(0x80FFFFFF);
+ 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);
+ //bullet[i].bulletspr->SetHotSpot(12,12);
if (eff)BulletEffect_Attatch(i);
return i;
}
@@ -285,8 +293,8 @@ 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);
+ //bullet[i].bulletspr=new hgeSprite(SprSheet,96,0,24,24);
+ //bullet[i].bulletspr->SetColor(0x80FFFFFF);
}
void All2pnt()
{
@@ -327,13 +335,11 @@ void ProcessBullet1(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -352,7 +358,7 @@ void ProcessBullet2(int i)
}
if (!DisablePlayer)
{
- if (LOWFPS)
+ /*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.
@@ -363,8 +369,9 @@ void ProcessBullet2(int i)
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].bulletspeed<bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*(1000.0f/hge->Timer_GetFPS());
bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x)/20*(1000.0f/hge->Timer_GetFPS());
bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*(1000.0f/hge->Timer_GetFPS());
}
@@ -382,9 +389,6 @@ void ProcessBullet2(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
return;
}
}
@@ -397,14 +401,12 @@ void ProcessBullet2(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
return;
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -450,13 +452,11 @@ void ProcessBullet4(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -489,13 +489,11 @@ void ProcessBullet5(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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)
@@ -554,9 +552,6 @@ void ProcessBullet6(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
BulletEffect_Process(i);
double dis=GetDist(bullet[i].bulletpos,playerpos);//Get distance between player and bullet
@@ -569,13 +564,11 @@ void ProcessBullet6(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -626,9 +619,6 @@ void ProcessBullet7(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
@@ -666,9 +656,6 @@ void ProcessBullet7(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
}
}
@@ -683,13 +670,11 @@ void ProcessBullet7(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- delete bullet[i].bulletspr;
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -726,13 +711,11 @@ void ProcessBullet8(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -761,9 +744,6 @@ void ProcessBullet9(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
}
if (bullet[i].redattrib==1)
@@ -796,9 +776,6 @@ void ProcessBullet9(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
}
if (bullet[i].redattrib==1)
@@ -823,13 +800,11 @@ void ProcessBullet9(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
-#ifndef NO_FREE
- if (bullet[i].bulletspr)free(bullet[i].bulletspr);
-#endif
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ //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();
}
}
@@ -871,7 +846,9 @@ void ProcessBullet255(int i)
}
else
{
- bullet[i].bulletspr->RenderEx(bullet[i].bulletpos.x,bullet[i].bulletpos.y,0,0.5,0);
+ //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.
@@ -897,11 +874,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].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);
+ //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.
@@ -924,9 +902,10 @@ 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].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;
}
@@ -951,9 +930,10 @@ 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].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;
}
@@ -978,9 +958,10 @@ 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].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;
}
@@ -1007,9 +988,10 @@ 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].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;
@@ -1037,9 +1019,10 @@ 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].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;
}
@@ -1068,9 +1051,10 @@ 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].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;
}
@@ -1098,9 +1082,10 @@ 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].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;
return i;
@@ -1131,10 +1116,11 @@ 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].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);
+ //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)
@@ -1163,10 +1149,11 @@ 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].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);
+ //tower[i].towerspr->SetHotSpot(22,22);
return i;
}
void ProcessTower1()
@@ -1174,7 +1161,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1198,7 +1187,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1219,7 +1210,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1280,7 +1273,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1298,7 +1293,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1316,7 +1313,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1334,7 +1333,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1352,7 +1353,9 @@ 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);
+ //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;
if (!tower[i].dblstate)
{
@@ -1409,7 +1412,9 @@ 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);
+ //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;
if (LOWFPS)
tower[i].curtimer-=17;
@@ -1566,11 +1571,13 @@ void CreateBullet2(Bullet &Tar,double x,double y,double bs,double rad,bool eff=f
Tar.bulletdir.x=cos(rad);
Tar.bulletdir.y=sin(rad);
Tar.bulletspeed=bs;
+ Tar.alterColor=blue;
+ 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);
+ //Tar.bulletspr=new hgeSprite(SprSheet,0,0,24,24);
+ //Tar.bulletspr->SetColor(0x80FFFFFF);
+ //Tar.bulletspr->SetHotSpot(12,12);
}
void ProcessBullet2(Bullet &xbul)
{
@@ -1600,7 +1607,8 @@ void ProcessBullet2(Bullet &xbul)
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);
+ //xbul.bulletspr->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.5);
+ bulletspr[xbul.alterColor]->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.6*xbul.scale);
}
//"Noname"
class Noname01dotpas