Type Player
Field entity,model, anim_speed#,player_y#,roll#
End Type
Type ChaseCam
Field entity,camera,target,heading,sky
End Type
Type Hole
Field alpha#,sprite
End Type
Const TYPE_PLAYER=3,TYPE_TARGET=1, TYPE_SCENERY=10,TYPE_LEVEL=2
Collisions TYPE_PLAYER,TYPE_LEVEL,2,3
Collisions TYPE_PLAYER,TYPE_SCENERY,2,2
Collisions TYPE_TARGET,TYPE_LEVEL,2,2
Collisions TYPE_TARGET,TYPE_SCENERY,2,2
Global light,castle,land,ground,water,sky
Global spark_sprite,bull_sprite,player_model,hole_sprite,tree_sprite
Global bull_x#=1.5
Setup()
LoadEnviron( "terrain-1.jpg","water-2_mip.bmp","sky","heightmap_256.bmp" )
player1.Player=CreatePlayer( 0,10,0 )
camera1.ChaseCam=CreateChaseCam( player1\entity )
period=1000/FPS
time=MilliSecs()-period
While Not KeyHit(1)
Repeat
elapsed=MilliSecs()-time
Until elapsed
ticks=elapsed/period
tween#=Float(elapsed Mod period)/Float(period)
For k=1 To ticks
time=time+period
If k=ticks Then CaptureWorld
UpdateGame()
UpdateWorld
PositionEntity water,Sin(time*.01)*10,water_level+Sin(time*.05)*.5,Cos(time*.02)*10
For c.ChaseCam=Each ChaseCam
UpdateChaseCam( c )
Next
Next
RenderWorld tween
Flip
Wend
End
Function UpdateGame()
[...]
End Function
Function UpdateHole( h.Hole )
[...]
End Function
Function CreatePlayer.Player( x#,y#,z# )
[...]
End Function
Function UpdatePlayer( p.Player )
[...]
End Function
Function CreateChaseCam.ChaseCam( entity )
[...]
End Function
Function UpdateChaseCam( c.ChaseCam )
[...]
End Function
Function LoadEnviron( land_tex$,water_tex$,sky_tex$,height_map$ )
[...]
End Function
Function Setup()
[...]
End Function