Hello
I'm experiencing some problems using certain functions from
demo05 - fps example.
When refreshing the physical system, for some reason random objects (their position is assigned from a file ) appear in the coordinate center instead of the place assigned.
To make it clear - let us modify your code a little bit by adding
'start_prg' tag in the beginning and assigning going to this tag
to "q" button.
start_prg:
sync on
sync rate 60
autocam off
set ambient light 100
set point light 0, 50, 100, 20
set light range 0, 5000
randomize timer()
load image "..\media\floor.png",1
load image "..\media\fps\bullethole.png", 2
position camera 0.0, 5.0, -20.0
dim GOSTR$(2)
GOSTR$(1) = "SIMULATION PAUSED"
GOSTR$(2) = "SIMULATION RUNNING"
global Player = 0
global Player_Mass# = 12.0
global Player_Speed# = 10.0
global Player_Yangle# = 0.0
global Player_Xangle# = 0.0
global Player_ShootPower# = 5000.0
global Player_JumpSpeed# = 35.0
global Door = 0
global DoorSlider = 0
NDB_NewtonCreate
NDB_SetVector 0.0, -50.0, 0.0
NDB_SetStandardGravity
gosub MakeRoom
gosub MakePlayer
time# = NDB_GetElapsedTimeInSec()
time# = NDB_GetElapsedTimeInSec()
GO = 1
do
time# = NDB_GetElapsedTimeInSec()
if GO = 1 then NDB_NewtonUpdate time#
if lower$(inkey$()) = "q" then goto start_prg:
For the first time it runs with no problems - boxes, spheres and cylinders
are generated in the right (random) positions. But once you refresh the code by pressing "q" button all objects are generated in 0,0,0 - frankly, i just
don't get why it happens.
At the time i can't restart current levels or go to the next ones properly -
so, as you see, i really need some assistance here - could you please tell me
what's wrong with the code?
Thank you very much
Life is beast. Beast must die