ATM - yes...
But its just for testing - I decided to finish my map loader tomorrow + a working bike physic
I hope progress is going well...
I have had a very close look into the onfoot stuff which appears very simple to me
//Edit:
Messed arround with bike physics:
co_Speed = 200.0
co_Accel = 10.0
co_Grip = 0.5
co_Gravity = 0.0
co_Mass = 1000.0
if co_Mass => 10000 then co_Mass = 10000
co_NewMass = 10000 - co_Mass
if co_Grip => 1 then co_Grip = 1
co_NewGrip = (1 - co_Grip) * 100
sn_SpnX = 0
sn_SpnY = 100
sn_SpnZ = 0
sn_VelX = 0
sn_VelY = 0
sn_VelZ = 50
do
if sn_VelX > 0
sn_VelX = sn_VelX - ((co_NewMass / co_NewGrip) / 50)
else
if sn_VelX < 0 then sn_VelX = sn_VelX + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_VelX) => abs(0.2) then sn_VelX = 0
if sn_VelY > 0
sn_VelY = sn_VelY - ((co_NewMass / co_NewGrip) / 50)
else
if sn_VelY < 0 then sn_VelY = sn_VelY + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_VelY) => abs(0.2) then sn_VelY = 0
if sn_VelZ > 0
sn_VelZ = sn_VelZ - ((co_NewMass / co_NewGrip) / 50)
else
if sn_VelZ < 0 then sn_VelZ = sn_VelZ + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_VelZ) => abs(0.2) then sn_VelZ = 0
sn_VelY = 0
if sn_SpnX > 0
sn_SpnX = sn_SpnX - ((co_NewMass / co_NewGrip) / 50)
else
if sn_SpnX < 0 then sn_SpnX = sn_SpnX + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_SpnX) => abs(0.2) then sn_SpnX = 0
if sn_SpnY > 0
sn_SpnY = sn_SpnY - ((co_NewMass / co_NewGrip) / 50)
else
if sn_SpnY < 0 then sn_SpnY = sn_SpnY + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_SpnY) => abs(0.2) then sn_SpnY = 0
if sn_SpnZ > 0
sn_SpnZ = sn_SpnZ - ((co_NewMass / co_NewGrip) / 50)
else
if sn_SpnZ < 0 then sn_SpnZ = sn_SpnZ + ((co_NewMass / co_NewGrip) / 50)
endif
if 0-abs(sn_SpnZ) => abs(0.2) then sn_SpnZ = 0
sn_RotX = object angle x(1) + (sn_SpnX / 2)
sn_RotY = object angle y(1) + (sn_SpnY / 2)
sn_RotZ = object angle z(1) + (sn_SpnZ / 2)
sn_PosX = object position x(1) + sn_VelX
sn_PosY = object position y(1) + sn_VelY
sn_PosZ = object position z(1) + sn_VelZ
position object 1,sn_PosX,sn_PosY,sn_PosZ
rotate object 1,sn_RotX,sn_RotY, sn_RotZ
sn_CA = sn_CA + 1
if sn_CA => 360 then sn_CA = 0
sn_CX = (sin(sn_CA) * 50)
sn_CZ = (cos(sn_CA) * 50)
sn_CY = 15
position camera sn_CX + sn_PosX,sn_CY + sn_PosY,sn_CZ + sn_PosZ
point camera sn_PosX,sn_PosY,sn_PosZ
text 50,50, "Spin X: " + str$(sn_SpnX)
text 50,70, "Spin Y: " + str$(sn_SpnY)
text 50,90, "Spin Z: " + str$(sn_SpnZ)
text 50,130, "Velocity X: " + str$(sn_VelX)
text 50,150, "Velocity Y: " + str$(sn_VelY)
text 50,170, "Velocity Z: " + str$(sn_VelZ)
sync
loop
I did all code myself
- but just the correct rotations and the player control is missing...
About my programming style:
sn_ = Single / Float
co_ = Variant and Constant
va_ = Variant
ob_ = Object
im_ = Image
tx_ = Texture
sp_ = Sprite
sd_ = Sound
ln_ = Long/DWORD
in_ = Integer
by_ = Byte
bo_ = Boolean
...
If there is a new type i give a logic name
(i hope u rnt confused
)
It's me...