Hi all I hoping that someone out their can help me out with this. I have a cube placed on the map and when you press the space key a small sphere shoots out from the cube. I’m trying to get a particle effect of smoke to appear as the sphere moves away from the cube; it works for a ½ sec then it stops the game. Can someone please load this and see what I’m doing wrong I have been trying to get this for 3 days now. Any help is most appreciated!! Thank you an advance.
Sync On
Sync Rate 30
Backdrop on
Set camera range 1,5000
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem Make player pawn
Make object cube 10,25
position object 10,20,0,20
Rem Make shell
Make Object Sphere 2,2
Hide Object 2
rem ladd smoke for shell particles
Load Image "g:\Program Files\The Game Creators\Dark Basic Professional Trial\Projects\Marty\037005560.jpg",2
For x = 0 to 9
Make object plain x+11,5,5
Texture object x+11,2
rem set attributes of an object; 1 = object is displayed, 0 = transparency to be shown, 0 = both sides to be rendered
Set object x+11,1,0,0
rem make the object transparent
Ghost object on x+11
rem loop for x to count up to 9
Next x
rem intialize particle counter an index of which particle needs to be affected next.
Pn=10
Rem Main loop
Do
Rem Store Object angle
AngleY# = object angle Y(10)
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 10,10
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-180),20)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-180),20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 10,-10
Endif
Endif
If Leftkey()=1 then Yrotate object 10,Wrapvalue(AngleY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(AngleY#+5)
X# = Object position x(10)
Z# = Object position z(10)
Y# = Get Ground Height(1,X#,Z#)
Position object 10,X#,Y#+12.5,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,100)
CameraX# = Newxvalue(X#,AngleY#-180,100)
rem how high the camera will be from ground
Position camera CameraX#,Y#+32,CameraZ#
Point camera X#,Y#+32,Z#
Rem Shoot shell
rem looks to see if Space key has been press and if there is a shell still out there
if Spacekey()=1 and ShellLife=0
rem this pasition the shell with the tank with the x#,y#,and z# that are stored in the varibles that are in memory
Position object 2,X#,Y#+25,Z#
rem points the object in the same direction as the camera
Set object to camera orientation 2
rem this is how long the shell will be render on the screen
ShellLife = 30
rem now the object cam be seen in this case the shell
show object 2
Endif
If ShellLife > 0
Dec ShellLife
Move object 2,20
bX#=Object position X(2)
bY#=Object position Y(2)
bZ#=Object position Z(2)
rem increment the "Pn" variable to move to the next particle object
inc Pn
rem see if it has gone out of the bounds if so go back to 10
if Pn=20 then Pn=10
rem scale of the particle object to its original size
Scale object Pn,100,100,100
rem point the particle object at the camera and rotate the object
Position object Pn,bX#,bY#,bZ#
point object Pn,X#,Y#,Z#
Zrotate object Pn,rnd(180)
for x = 1 to 10
rem don't know
scale object int((Wrapvalue((Pn-9+x)*36))/36)+11,100+x*25,100+x*25,100+x*25
rem set cursor 10,10
rem print int((Wrapvalue((Pn+x)*36))/36)+11
next x
if ShellLife = 0
Hide object 2
endif
Endif
Rem Refresh Screen
Sync
Loop
WindowsXP Professional, AMD Athlon 2.500+ GHz CPU, 512 MB of RAM, GEForce2 MX 64mb of RAM. Let the Game's Begin...