aboutsummaryrefslogtreecommitdiff
path: root/effects.h
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-03 23:28:31 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-03-03 23:28:31 +0000
commit4f062725e3d2d104a40432b341ae2345ade5cfca (patch)
tree02f4e52646c632a57551e68fa4309a9c8555e92b /effects.h
parenta404f537e1f260040063b65461213800c896e15c (diff)
downloadbullet-lab-remix-4f062725e3d2d104a40432b341ae2345ade5cfca.tar.xz
Remove useless statements, and some interface-compatible changes.
Diffstat (limited to 'effects.h')
-rw-r--r--effects.h26
1 files changed, 7 insertions, 19 deletions
diff --git a/effects.h b/effects.h
index 27054b0..ab63cbf 100644
--- a/effects.h
+++ b/effects.h
@@ -1,7 +1,6 @@
//Chrisoft Bullet Lab Remix HGE
//Effects Implementations
//Copyright Chrisoft 2014
-#define NO_FREE 1
//static const char* EFFECTS_H_FN="effects.h";
void SCEffect_Attatch()
@@ -20,43 +19,37 @@ void SCEffect_Attatch()
}
bullet[i].exist=true;
bullet[i].bullettype=254;
- bullet[i].bulletpos.x=playerpos.x;
- bullet[i].bulletpos.y=playerpos.y;
+ bullet[i].bulletpos.x=playerpos.x+3;
+ bullet[i].bulletpos.y=playerpos.y+3;
bullet[i].bulletdir.x=rand()%100-50;
bullet[i].bulletdir.y=rand()%100-50;
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].sccolor=0x80FFFFFF;
}
}
void SCEffect_Process(int i)
{
- //for (int i=1;i<=bulcnt;++i)
- //{
- if (!bullet[i].exist||bullet[i].bullettype!=254)return;//If this bullet doesn't exist or is not of this type, do not render it.
+ if (!bullet[i].exist||bullet[i].bullettype!=254)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;
++effskp;
if (effskp==7)
bullet[i].sccolor=bullet[i].sccolor-0x1F000000,effskp=0;
}
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;
++effskp;
if (effskp==7)
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.
}
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)
{
@@ -65,17 +58,12 @@ void SCEffect_Process(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+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);
}
- //}
}
void BulletEffect_Attatch(int n)
{