January 20, 2021, 09:39:27 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] dragon fire by Afke [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] dragon fire by Afke [ 1+ years ago ] (Read 1341 times)
BlitzBot
Jr. Member
Posts: 1
[bb] dragon fire by Afke [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:43 AM »
Title :
dragon fire
Author :
Afke
Posted :
1+ years ago
Description :
the old dragon with fire effect
Code :
Code: BlitzBasic
Graphics3D
800
,
600
,
32
,
1
SetBuffer
BackBuffer
(
)
enable=
True
vert=
False
Global
camera=
CreateCamera
(
)
;environment cube
cube=
CreateCube
(
)
FitMesh
cube,-
250
,
0
,-
250
,
500
,
500
,
500
FlipMesh
cube
tex=
LoadTexture
(
"D:Program FilesBlitz3Dsamplesmakdragonchorme-2.bmp"
)
ScaleTexture
tex,
1.0
/
3
,
1.0
/
3
EntityTexture
cube,tex
EntityAlpha
cube,.4
EntityFX
cube,
1
;floor mirror
m=
CreateMirror
(
)
;simple light
light=
CreateLight
(
)
TurnEntity
light,
45
,
45
,
0
dragon=
LoadMD2
(
"D:Program FilesBlitz3Dsamplesmakdragonmodeldragon.md2 "
)
tex=
LoadTexture
(
"D:Program FilesBlitz3Dsamplesmakdragonmodeldragon.bmp"
)
PositionEntity
dragon,
0
,
25
,
0
EntityTexture
dragon,tex
AnimateMD2
dragon,
1
,
0.05
,
90
,
130
;camera
camera=
CreateCamera
(
)
cam_xr#=
30
:cam_yr#=
0
:cam_zr#=
0
:cam_z#=-
100
;--------------- fire--------------------
pivFire=
CreatePivot
(
)
Type
fire
Field
x#
Field
y#
Field
z#
Field
alpha#
Field
entity
Field
scale#
End Type
sprite=
LoadSprite
(
"D:Igra Draculaspritefire.bmp"
,
2
,pivFire
)
PositionEntity
sprite,
3
,
20
,
43
RotateEntity
sprite,
0
,
90
,
0
HideEntity
sprite
con#=
0.5
:conx#=
0.3
:no=
5
Md=
4
;----------------------------------------
time=
MilliSecs
(
)
While
Not
KeyDown
(
1
)
;-------------- mod of fire------
If
Md=
1
Then
a1=
117
:b1=
122
con#=
1
:conx#=
0.8
:no=
5
PositionEntity
sprite,
3
,
20
,
43
RotateEntity
sprite,
0
,
90
,
0
End If
If
Md=
2
Then
a1=
125
:b1=
127
con#=
0.4
:conx#=
0.4
:no=
1
PositionEntity
sprite,-
18
,
10
,
23
End If
If
Md=
3
Then
a1=
100
:b1=
102
con#=
0.4
:conx#=
0.3
:no=
3
PositionEntity
sprite,-
3
,
3
,
33
End If
If
Md=
4
Then
a1=
90
:b1=
93
con#=
1
:conx#=
1
:no=
7
PositionEntity
sprite,
10
,
15
,
43
RotateEntity
sprite,
0
,
75
,
0
End If
;--------------- fire --------------------
u=u+
1
If
u>
360
Then
u=
1
Repeat
elapsed=
MilliSecs
(
)
-time
Until
elapsed>
0
time=time+elapsed
dt#=elapsed*
60.0
/
1000.0
anim=
MD2AnimTime
(
dragon
)
If
anim>
129
Then
Md=
4
End If
If
anim>
93
And
anim<
100
Then
Md=
3
End If
If
anim>
100
And
anim<
122
Then
Md=
1
End If
If
anim>
122
And
anim<
127
Then
Md=
2
End If
If
anim>a1
And
anim<b1
For
i=
1
To
no
f.fire=
New
fire
falpha#=
1
;Rnd(0,1)
fscale#=con#*
Rnd
(
8
,
12
)
fentity=
CopyEntity
(
sprite,piv1
)
SpriteViewMode
fentity,
1
RotateSprite
fentity,
Rnd
(
360
)
num=mum+
1
Next
End If
For
f.fire=
Each
fire
falpha#=falpha#-
0.02
;fscale#=fscale#-Rnd(0.02,0.1)
If
falpha>
0
EntityAlpha
fentity,falpha
If
falpha#<0.4Then
EntityColor
fentity,
80
,
200
,
150
fx#=con#*conx#*
3
fy#=con#*
Rnd
(
2.4
,
6.4
)
fz#=con#*
Rnd
(
-
4.8
,
4.8
)
ElseIf
falpha#<
0.8
And
falpha#>0.4Then
fscale#=con#*
Rnd
(
10
,
14
)
fx#=con#*conx#*
4
;Rnd(1.9,2)
fy#=con#*
Rnd
(
-
6
,
6
)
fz#=con#*
Rnd
(
-
6
,
6
)
Else
fscale#=con#*
4
fx#=con#*conx#*
Rnd
(
2
,
4
)
fy#=con#*
Rnd
(
-
2
,
2
)
fz#=con#*
Rnd
(
-
2
,
2
)
EndIf
ScaleSprite
fentity,fscale#,fscale#
MoveEntity
fentity,fx,fy,fz
Else
FreeEntity
fentity
Delete
f
num=num-
1
EndIf
Next
;--------------------------------------------
If
KeyDown
(
17
)
WireFrame
enable
If
KeyDown
(
203
)
cam_yr=cam_yr-
2
Else
If
KeyDown
(
205
)
cam_yr=cam_yr+
2
EndIf
If
KeyDown
(
200
)
cam_xr=cam_xr+
2
If
cam_xr>
90
cam_xr=
90
Else
If
KeyDown
(
208
)
cam_xr=cam_xr-
2
If
cam_xr<
5
cam_xr=
5
EndIf
If
KeyDown
(
26
)
cam_zr=cam_zr+
2
Else
If
KeyDown
(
27
)
cam_zr=cam_zr-
2
EndIf
If
KeyDown
(
30
)
cam_z=cam_z+
1
:
If
cam_z>-
10
cam_z=-
10
Else
If
KeyDown
(
44
)
cam_z=cam_z-
1
:
If
cam_z<-
180
cam_z=-
180
EndIf
PositionEntity
camera,
0
,
0
,
0
RotateEntity
camera,cam_xr,cam_yr,cam_zr
MoveEntity
camera,
0
,
0
,cam_z
If
KeyDown
(
16
)
surf=
GetSurface
(
dragon,
1
)
If
KeyDown
(
78
)
Then
x=x+
1
If
x>
CountVertices
(
surf
)
Then
x=
CountVertices
(
surf
)
vert=
True
End If
If
vert=
True
Then
VertexX
(
surf,x
)
VertexY
(
surf,x
)
VertexZ
(
surf,x
)
VertexColor
surf,a,
255
,
0
,
0
,
1
EndIf
UpdateWorld
RenderWorld
Flip
Wend
End
Comments :
Pedro(Posted 1+ years ago)
Could you provide the texture :sprite=LoadSprite("D:Igra Draculaspritefire.bmp",2,pivFire)thanks:)
Afke(Posted 1+ years ago)
you can use fire texture from exsample never mind it will be good
Barliesque(Posted 1+ years ago)
Nice effect!I replaced the fire.bmp file with...C:Program FilesBlitz3DsamplesHi-ToroShooterShootergfxfire.bmp
Afke(Posted 1+ years ago)
Ok man nice thanks for compliment
Rogue Vector(Posted 1+ years ago)
add this line:EntityBlend fentity, 3It will look even more realistic.Rogue Vector
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] dragon fire by Afke [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal