I'm making a game (big suprise) and I need a cube to jump from platform to platform, to the other side of the screen. Tight now I am having slight difficulties with making the cube not fall through the platforms... help anyone?
`Declare Variables
x#=0 : y#=10 : z#=0
grav#=.5
Set Global Collision Off
`Load Awsome background
Load Object "Media/SS/ss.x",100
Scale Object 100,15,15,15
`Make Platform
Make Object Cube 10,100
Scale Object 10,100,8,200
Set object Collision On 10
Make Object Collision Box 10,-50,-1,-50,50,15,50,1
Color Object 10,rgb(100,100,0)
Position Object 10,0,-60,-100
Make Object Cube 11,100
Scale Object 11,100,8,200
Set object Collision On 11
Make Object Collision Box 11,-50,-1,-50,50,15,50,0
Color Object 11,rgb(100,0,100)
Position Object 11,0,-55,0
`Make Cube
Make Object Cube 1,10
Set object Collision On 1
Make Object Collision Box 1,-5,-5,-5,5,5,5,0
Color Object 1,rgb(200,0,0)
Position Object 1,0,20,0
`Main Game Loop
Do
`Placing things
position object 1,x#,y#,z#
`Movement
a#=object angle y(1)
d#=70
h#=40
s#=10
if upkey()=1 then x#=newxvalue(x#,a#,1) : z#=newzvalue(z#,a#,1)
if downkey()=1 then x#=newxvalue(x#,a#,-1) : z#=newzvalue(z#,a#,-1)
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-4)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+4)
if spacekey()=1 and grav#=0 then grav#=3
Collision=object collision(1,0)
Set Cursor 20,20
Print Collision
`Gravity
if Collision=0 then grav#=grav#-0.1
if Collision>0 then grav#=0
y#=y#+grav#
if y#<-100
grav#=0
y#=10
x#=0
z#=0
endif
`Camera
set camera to follow x#,y#,z#,a#,d#,h#,s#,1
`End Main Game
Loop
Am I dead yet?