From aa24dc151df4249483f9c46e0f11e47296a0e42a Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Mon, 3 Feb 2014 03:16:50 +0000 Subject: 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 --- effects.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'effects.h') 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); } } -- cgit v1.2.3