diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-03-06 02:18:38 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-03-06 02:18:38 +0000 |
commit | c754439aecc45517865d38c750b76730fca0e7ed (patch) | |
tree | 897306d2868f2cdd76abb8468e9322e544c5b3c5 | |
parent | 6ede37a57f55a32d92432a384c7a8c73e58271f3 (diff) |
Updated particles and added shield loss feedback
-rw-r--r-- | shockwave.bb | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/shockwave.bb b/shockwave.bb index ce8273f..8250241 100644 --- a/shockwave.bb +++ b/shockwave.bb @@ -1,7 +1,7 @@ ; ; SHOCKWAVE (c) COPYRIGHT Ian Cowburn 2004 ; -; $Id: shockwave.bb,v 1.6 2005-03-06 01:40:21 ianc Exp $ +; $Id: shockwave.bb,v 1.7 2005-03-06 02:18:38 ianc Exp $ ; Include "gfx/font.bb" @@ -14,6 +14,8 @@ Type Particle Field id Field a# Field ai# + Field spin# + Field dx#,dy#,dz# Field life End Type @@ -502,6 +504,13 @@ Repeat MAX_SPEED=MAX_SPEED-0.1 NewCameraSpriteText(Str$(MAX_SPEED),$ff0000,0,5,EntityZ(camera)+50,-0.2,1,0.005) EndIf + If KeyHit(64) + For ast.Asteroid=Each Asteroid + FreeEntity ast\id + Delete ast + Next + NewCameraSpriteText("DELALL",$ff0000,0,5,EntityZ(camera)+50,-0.2,1,0.005) + EndIf If KeyHit(65) SubShield(shield) NewCameraSpriteText("NOSHLD",$ff0000,0,5,EntityZ(camera)+50,-0.2,1,0.005) @@ -1002,6 +1011,7 @@ Function UpdateAsteroids() If hit_ship SubShield(1) + NewParticleMove(particle,EntityX(ship),EntityY(ship),EntityZ(ship)-1,10,2,Rnd(-2,2),Rnd(-2,2),0) ElseIf hit_sw Or a\split If Not dead @@ -1012,8 +1022,10 @@ Function UpdateAsteroids() If Not a\split EmitSound(pop_sfx,a\id) + dz#=0.1 For f=10 To 100 Step 10 - NewAlphaParticle(particle,EntityX(a\id),EntityY(a\id),EntityZ(a\id)-f,1.0,-0.01) + NewAlphaParticleMove(particle,EntityX(a\id),EntityY(a\id),EntityZ(a\id)-f,1.0,-0.01,f/10,0,0,dz) + dz=dz+0.1 Next EndIf @@ -1233,19 +1245,34 @@ Function UpdateParticles() p\life=p\life-1 p\a=p\a+p\ai EntityAlpha p\id,p\a + TurnEntity p\id,0,0,p\spin + MoveEntity p\id,p\dx,p\dy,p\dz EndIf Next End Function -Function NewParticle(base,x#,y#,z#,life) +Function NewParticle(base,x#,y#,z#,life,spin#) + NewParticleMove(base,x,y,z,life,spin,0,0,0) +End Function + +Function NewParticleMove(base,x#,y#,z#,life,spin#,dx#,dy#,dz#) p.Particle=New Particle p\id=CopyEntity(base) ShowEntity p\id PositionEntity p\id,x,y,z p\life=life + p\a=1.0 + p\dx=dx + p\dy=dy + p\dz=dz + p\spin=spin +End Function + +Function NewAlphaParticle(base,x#,y#,z#,a#,ai#,spin#) + NewAlphaParticleMove(base,x,y,z,a,ai,spin,0,0,0) End Function -Function NewAlphaParticle(base,x#,y#,z#,a#,ai#) +Function NewAlphaParticleMove(base,x#,y#,z#,a#,ai#,spin#,dx#,dy#,dz#) p.Particle=New Particle p\id=CopyEntity(base) ShowEntity p\id @@ -1254,6 +1281,10 @@ Function NewAlphaParticle(base,x#,y#,z#,a#,ai#) p\life=9999999 p\a=a p\ai=ai + p\dx=dx + p\dy=dy + p\dz=dz + p\spin=spin End Function @@ -1561,6 +1592,7 @@ Function Menu() HudTextCentre(200,"LARGEST LOST CHAIN",$ffffff) AddScore(0) + start_bonus=(start_level-1)^2*1000 ti=MilliSecs() |