Flight Simsih Clouds

Miscellaneous Forums/Blitz Showcase/Flight Simsih Clouds

Just add this somewhere before the main loop in the xfighter demo. You'll need to create 3 cloudpuff images (I borrowed from x-plane but these are easily made). Again this is straight from Vorderman's fog code with just a few lines to provide scale and puff image variety. If you want to make them move just update the pivot "testpiv". Hide the existing cloud plne in the demo for best results.

;-------------- CONSTANTS ---------------------------
;Const gameFPS = 50 ;frame limiting
Const MAX_FOG = 2000
Const SPREAD# = 4000
Const GLOBAL_MUSH# = 1.0


;-------------- GLOBALS -----------------------------
Global CAM_yaw# = 0.0
Global CAM_zoom# = 20
Global NULLPIVOT = CreatePivot()


;-------------- TYPES -------------------------------
Type TYPE_FOG
Field x#,y#,z#
Field xs#,zs#
Field sprite
Field ax#,az#
Field mushiness#
End Type

Dim FOG.TYPE_FOG(MAX_FOG)
testpiv=CreatePivot()
For a=1 To MAX_FOG
FOG.TYPE_FOG(a) = New TYPE_FOG
fsprite=Rand(1,3)
If fsprite=1
FOG(a)\sprite = LoadSprite("cld_puff_1.png",2,testpiv) ;was 1
EndIf
If fsprite=2
FOG(a)\sprite = LoadSprite("cld_puff_2.png",2,testpiv) ;was 1
EndIf
If fsprite=3
FOG(a)\sprite = LoadSprite("cld_puff_3.png",3,testpiv) ;was 1
EndIf

SpriteViewMode FOG(a)\sprite,3
EntityAlpha FOG(a)\sprite,Rnd#(0.2,1.0)

rscale#=Rnd#(50.0,200.0)
ScaleSprite FOG(a)\sprite,rscale#,rscale#
FOG(a)\x# = Rnd#(-SPREAD#,SPREAD#)
FOG(a)\y# = Rnd#(-1,2)
FOG(a)\z# = Rnd#(-SPREAD#,SPREAD#)
FOG(a)\xs# = 0.0
FOG(a)\zs# = 0.0
FOG(a)\ax# = FOG(a)\x#
FOG(a)\az# = FOG(a)\z#
PositionEntity FOG(a)\sprite,FOG(a)\x#,FOG(a)\y#,FOG(a)\z#
FOG(a)\mushiness# = 0.25
Next



MoveEntity testpiv,0,350,-10