How Do I make it so when I collide into the bottom plain it will put me back at the start of the game? I can't figure it out...
Thanks.
sync on
sync rate 60
gravity# = .1
jump as boolean : jump = 0
rem velocity is constant
global velocity# as float
velocity#=0.1
color backdrop 0
rem Player
make object cube 1,10
make light 1
set light range 1,90000
make object collision box 1,-5,-5,-5,5,5,5,0
rem Walls
`floor
make object plain 2, 100, 100
point object 2, 0, -50, 0
position object 2, 0, -3.5, 0
`Bottom wall
make object plain 5,1000,1000
point object 5,0,-50,0
position object 5,0,-500,0
`Steps
rem Make a pedestal steps
NumberOfSteps = 5
for t=0 to NumberOfSteps
make object box 6+t,50,8,50
position object 6+t,0,NumberOfSteps+(t*10),100+(t*100)
color object 6+t,white
next t
`Steps Collison
for t=0 to NumberOfSteps
make object collision box 6+t,-25,-4,-25,25,4,25,0
next t
Start:
do
rem control movement
if rightkey()=1 then turn object right 1,3
if leftkey()=1 then turn object left 1,3
if upkey()=1 then move object 1,3
if downkey()=1 then move object 1,-3
rem control jumping
if spacekey()=1 and gravity#=0.0 then gravity#=2.0
rem get positions of object
posx#=object position x(1)
posy#=object position y(1)
posz#=object position z(1)
rem control gravity
dec gravity#,velocity#
inc posy#,gravity#
`COLLISON
position object 1,posx#,posy#,posz#
if object collision(1,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
if get object collision y()<>0 then gravity# = 0.0
endif
rem update player positions
position object 1,posx#,posy#,posz#
`And I changed this bit a little too :)
`I changed this bit
position camera posx#,posy#,posz#
set camera to object orientation 1
move camera -100
pitch camera up 90
move camera 50
point camera posx#,posy#,posz#
`up to here
`until here
sync
loop
Wait. What?