CODE
; Jumping Cone
;_______________
camdistance=10
Graphics3D 640,480
SetBuffer BackBuffer()
; Creating the types
type_player=1
type_ground=2
; Create camera
camera=CreateCamera()
RotateEntity camera, 45,0,0
; Create a light
light=CreateLight()
; Creating a plane and texture
grid_tex=CreateTexture( 32,32,8 )
ScaleTexture grid_tex,10,10
SetBuffer TextureBuffer( grid_tex )
Color 0,0,64:Rect 0,0,32,32
Color 0,0,255:Rect 0,0,32,32,False
SetBuffer BackBuffer()
grid_plane=CreatePlane()
EntityTexture grid_plane,grid_tex
EntityBlend grid_plane,1
EntityAlpha grid_plane,.6
EntityFX grid_plane,1
EntityType grid_plane, type_ground
; Creating a mirror
CreateMirror()
; Creating a cone
cone=CreateCone(64)
EntityType cone,type_player
PositionEntity cone, 0,1,5
ScaleEntity cone,0.4,0.4,0.4
EntityRadius cone, 0.5
Texture=CreateTexture(16,16): SetBuffer TextureBuffer(texture)
ClsColor 256,6,56
Cls
Color 12,126,256
Rect 0,0,8,8,1
Rect 8,8,8,8,1
ScaleTexture Texture,.2,.2
EntityTexture cone,texture
; The following code makes the program run
While Not KeyDown( 1 )
y#=0
If KeyDown( 208 )=True Then velocity#=velocity#-0.001
If KeyDown( 200 )=True Then velocity#=velocity#+0.001
If KeyDown ( 31 ) Then velocity#=0
If KeyDown ( 31 ) Then xvelocity#=0
If KeyDown( 203 )=True Then xvelocity#=xvelocity#-0.001
If KeyDown( 205 )=True Then xvelocity#=xvelocity#+0.001
If KeyDown( 57 )=True Then y#=y#+0.5
MoveEntity cone,xvelocity#,y#,velocity#
TranslateEntity cone, 0,-0.1,0
PositionEntity camera, EntityX(cone),0,EntityZ(cone)
MoveEntity camera,0,0,-5
Collisions type_player,type_ground,2,2
Collisions type_ground,type_player,2,2
UpdateWorld
RenderWorld
Flip
Wend
End