From 8b96010f277756c9e1a6e4e17ccf5722ed8d87e3 Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Thu, 27 Mar 2014 13:42:29 +0000 Subject: New level draft and a new interface. --- towernbullet.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'towernbullet.h') diff --git a/towernbullet.h b/towernbullet.h index f138ee8..71de714 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -71,8 +71,8 @@ int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool inv bullet[i].bullettype=2; bullet[i].bulletpos.x=x; bullet[i].bulletpos.y=y; - bullet[i].bulletdir.x=cos(rad); - bullet[i].bulletdir.y=sin(rad); + bullet[i].bulletdir=vector2d(cos(rad),sin(rad)); + bullet[i].limpos=vector2d(-999,-999); bullet[i].bulletspeed=bs; bullet[i].alterColor=blue; bullet[i].alterColor2=COLOR_COUNT; @@ -357,6 +357,15 @@ void ProcessBullet2(int i) bullet[i].whirem-=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()); + if(GetDist(bullet[i].bulletpos,bullet[i].limpos)<1) + { + BulletEffect_Death(bullet[i],ColorToDWORD(bullet[i].alterColor)); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0;return; + } } BulletEffect_Process(i); if(PlayerSplit) -- cgit v1.2.3