Dragon with Fire Help

Blitz3D Forums/Blitz3D Beginners Area/Dragon with Fire Help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

As ar as I see you have the initialisation and the update in the same function, which is a nono. Make one function to init the thing (loading dragon, loading sprites etc. initialize start values of variables) and a second function that will update the fire etc. I think you need to learn this anyway, so I will not show you where exactly the init parts and the update parts of your program are, only one thing:

A program usually loads thing and then branches to an endless loop that may be ended with the Escape Key:

mesh=LoadMEsh("thingie.3ds")

while keydown(1)=0
; update object 1
turnentity mesh,0,1,0 ; (example)

renderworld()
Flip
wend

The fire seems to be some kind of particle engine. This part:

;--------------- fire--------------------
pivFire=CreatePivot()

sprite = LoadSprite("C:\blitz3D\Blitz3D\samples\dragon\Fire.bmp ",2,pivFire)
PositionEntity sprite,3,20,43,False
RotateEntity sprite,0,90,0,False
HideEntity sprite
con#=0.5:conx#=0.3:no=5
Md=4
;----------------------------------------
time=MilliSecs()


is the initialisation of the fire. The rest down to the flip, is the update part that needs a special function that can be called frequently. I wouldn't use the flip there, instead do it this way:

while keydown(1)=0 ; main loop
update_fire()
rednerworld()
flip
wend

See also the timing code, that you may have to move to the main loop.