diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-27 13:42:29 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-27 13:42:29 +0000 |
commit | 8b96010f277756c9e1a6e4e17ccf5722ed8d87e3 (patch) | |
tree | 530013d1dfcf34b85d5c9f3dd006a04420afbf1a /towernbullet.h | |
parent | 1157b3359e5158e18e1342add9298aac2527bed4 (diff) | |
download | bullet-lab-remix-8b96010f277756c9e1a6e4e17ccf5722ed8d87e3.tar.xz |
New level draft and a new interface.
Diffstat (limited to 'towernbullet.h')
-rw-r--r-- | towernbullet.h | 13 |
1 files changed, 11 insertions, 2 deletions
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) |