`Urbia Rising
`Main Engine
Sync On
Sync rate 60
backdrop on
fog on
fog distance 4000
`Variables
Vitality = 100
`Make Hero
make object cube 1,20
Color object 1,RGB(200,0,50)
Position Object 1,400,0,500
Set object collision to boxes 1
`Make Rhino Tranq
Make object sphere 2,10
position object 2,700,12.5,600
Ghost object on 2
Set object collision to spheres 2
Make matrix 1,20000,20000,20,20
`Make platforms
For C= 3 to 10
Make object cube C,40
Color object C,RGB(0,0,100)
Next C
Position object 3,400,25,800
Position object 4,400,100,1000
Position object 5,440,100,1000
Position object 6,440,100,1040
Position object 7,440,100,1130
Position object 8,440,150,1130
Position object 9,540,100,1130
Position object 10,480,100,1160
` give the ball a torchlight
make light 1
Color light 1,RGB(50,50,50)
make object sphere 11,5
color object 11,RGB(100,100,100)
hide object 11
Do
`Huds
Ink RGB(0,0,0),0
Box 30,65,Vitality+2,85
Ink RGB(125,0,0),0
Box 31,66,Vitality+1,84
Set text font "arial"
Set text size 12
Ink RGB(255,255,255),0
text 35,53,"Vitality"
`Positioning
X# = Object position x(1)
Z# = Object position z(1)
Y# = Get Ground Height(1,X#,Z#)
Position object 1,X#,Y#+12.5,Z#
objectY# = Object Position Y(1)
RX# = Object position x(2)
RZ# = Object position z(2)
RY# = Get Ground Height(1,RX#,RZ#)
Position object 2,RX#,RY#+12.5,RZ#
`Controls
AngleY# = object angle Y(1)
If keystate(17)=1 and Speed < 50
Inc Speed
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<20000 and ZTest#>0 and ZTest#<20000
Move object 1,2
Endif
Endif
If keystate(17)=1 and Speed >= 50
Inc Speed
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<20000 and ZTest#>0 and ZTest#<20000
Move object 1,4
Endif
Endif
If keystate(17)=1 and Speed >= 100
Inc Speed
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<20000 and ZTest#>0 and ZTest#<20000
Move object 1,6
Endif
Endif
If keystate(17)=0
Dec Speed
Endif
If Speed < 0
Speed = 0
Endif
If Speed > 100
Speed = 100
Endif
If keystate(30)=1
Yrotate object 1,Wrapvalue(AngleY#-2.5)
Endif
If keystate(32)=1
Yrotate object 1,Wrapvalue(AngleY#+2.5)
Endif
`Camera Positioning
`Camera
CameraZ# = Newzvalue(Z#,AngleY#-180,100)
CameraX# = Newxvalue(X#,AngleY#-180,100)
CameraY# = Get Ground Height(1,CameraX#,CameraZ#)
Position camera CameraX#,CameraY#+60,CameraZ#
Point camera X#,Y#+25,Z#
`light
lightangle#=wrapvalue(lightangle#+5)
lightx#=newxvalue(x#,lightangle#,75)
lightz#=newzvalue(z#,lightangle#,75)
lighty#=y#
position object 11,lightx#,lighty#,lightz#
position light 1,lightx#,lighty#,lightz#
Sync
Loop
Function distance(obj1,obj2)
dist=sqrt(((object position x(obj1)-object position x(obj2))*(object position x(obj1)-object position x(obj2)))+((object position z(obj1)-object position z(obj2))*(object position z(obj1)-object position z(obj2))))
endfunction dist
Okay so this is part of my code that I've been making for an engine to create a platformer in DBC. And now I want to add jumping. However I can't get jumping to work and I've looked at other code. However none of it works. One code I could jump but I couldn't move forward when I jumped which is essential so the player can jump onto the platforms. (Will add collision for those once I get jumping down.) I looked at Tifu's jumping code but couldn'e implement into my game so now I've had enough. I've tried creating my own jumping engine but only the camera would move up and down, so can anyone provide a jumping code that will alow the player to move while jumping that works with this code. Please help me as it is an essential part to the engine. Thankyou for your time.
Have a heart and join my message board.

And now my messageboards work again!Woot!
