Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problem with Tutorial, some help needed!

Author
Message
DarrylKev
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location:
Posted: 1st Dec 2002 04:04
Hello

I'm in the process of running throught game building tutorial "www.darkbasic.com/create" and I am having a bit of a problem with Lesson 7,8 and 9 (simple particle,GoSub and Explosions). It seems that when I add the Explosion effect (tutorial 9) to the the flame effect from Tutorial 7 the flame only shoots once and never again unless I re-start the program.

It's probably something real simple but I just can't figure it out.

Any help I could get would be really appreciated. Here is what I have. Sorry fot the messy work.

DarrylKev



Rem gosub, math collde particles
Rem Setup sync
Sync On
Sync Rate 30
Hide Mouse
Backdrop on
Set camera range 1,5000

Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)

Rem Create Matrix
Make matrix 1,10000,10000,20,20

Rem Texture Matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1

Rem Randomize the matrix
randomize matrix 1,125
X#=5000
Z#=5000

Rem Make Gun
Make Object cylinder 1,2
XRotate object 1,90
Fix object pivot 1
Scale object 1, 100,100,500
position object 1,5,-7,15
Lock object on 1

Rem Make Bullet
Make Object sphere 2,2
Hide Object 2

Rem Load Particles
Load Image "fire.bmp",2
For X = 0 to 10
Make Object Plain x+10,5,5
Texture Object x+10,2
Set object x+10,1,0,0
Ghost Object On x+10
Next x

REM Initialize Particle Counter
Pn=10


Rem Load Sounds
Load sound "crickets.wav",1
Loop sound 1
Load 3Dsound "fireball2.wav",2

Rem Load Ninja
Load object "idle.x",21
Loop object 21
position object 21,5000,Get Ground Height(1,5000,5500),5500

mX#=Object position X(21)
mY#=Object position Y(21)
mZ#=Object position Z(21)

rem Make Explosion
Make Object Sphere 30,20
Texture object 30,2
Ghost Object On 30
Hide Object 30
Make Object Sphere 31,20
Texture Object 31,2
Ghost Object On 31
Hide Object 31
Load 3DSOUND "Explode.wav",3

Rem Main Loop
Do
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)

Rem Store Object Angle
REM CameraAngleY# = Camera angle Y()

Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,10)
ZTest# = Newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#270

if CameraAngleX#-270 > 90 then CameraAngleX#=270
else

if CameraAngleX# > 90 and CameraAngleX#-270 0 then GoSub ShootBullet

If Explode > 0 then GoSub ExplodeRocket

Rem Refresh Screen
Sync
Loop


ShootBullet:
If BulletLife > 0
Dec BulletLife
Move object 2,10
bX#=Object position X(2)
bY#=Object position Y(2)
bZ#=Object position Z(2)

if bY#
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 1st Dec 2002 04:07
It does it to me too. I stared at it for 2 hours, got a head ache and moved on.

I too would be intrerested in the answer.
cypher

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Dec 2002 05:12
set particle life 1 will keep them permantly on

set particle life 0 will turn it off from what i gather.

Login to post a reply

Server time is: 2024-03-28 16:06:10
Your offset time is: 2024-03-28 16:06:10