Shooting

Blitz3D Forums/Blitz3D Programming/Shooting

I am making a Star Trek Fan Show but I need help.

What should I use as a phaser? How should I shoot it at another ship? And how do I make a 3D explosion?

Maybe a bunch of cylinders with different alpha settings ?
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

ship1 = CreateCube()
ship2 = CreateCube()

cam = CreateCamera()
MoveEntity cam, 0, 0, -5

PositionEntity ship1, -4, -4, 0
PositionEntity ship2,  4,  4, 0

beam = CreatePivot()
For c = 1 To 5
	sc# = (c * 0.02) + 0.02
	beamp = CreateCylinder(5, 0, beam)
	PositionMesh beamp, 0, 1, 0
	ScaleMesh beamp, sc,  5, sc
	RotateMesh beamp, 90, 0, 0
	EntityFX beamp, 1
	EntityAlpha beamp, 0.4
Next
EntityColor beamp, 0, 0, 255

HideEntity beam

Repeat

	TurnEntity ship2, 0, 1, 0
	MoveEntity ship2, 0, 0, 0.1

	If KeyHit(57) Then
		PositionEntity beam, EntityX(ship1), EntityY(ship1), EntityZ(ship1)
		ShowEntity beam
		beamtime = 50
	End If
	
	If beamtime > 0 Then
		PointEntity beam, ship2
		beamtime = beamtime - 1
		If beamtime < 1 Then HideEntity beam
	End If
	
	RenderWorld
text 0, 0, "use space to fire"
	Flip
	
Until KeyHit(1)

End

For 3d explositions, look in the code archive. Else, you could try using an explosition animationstrip, and put it on a sprite using LoadAnimTexture.

particlecandy does nice explosions, it even comes with a few...

Oh, okay thanks! I will try that!