Hello all!
I'm having an issue with my game. For some reason, it will not let the model jump. I've gone through and tried to see what the problem is, but I cannot figure it out. Does anyone have an idea what the problem may be?
REM OBJECT CREATION
Rem Player Character
load object \\\\\\\"P:\\\\\\\\Mr Coffeys Classes\\\\\\\\Dark Basic Cert Files\\\\\\\\3_2RoomDemo\\\\\\\\media\\\\\\\\hero\\\\\\\\roomdemo.x\\\\\\\",1
scale object 1,50,70,50
texture object 1,1
position object 1,0,0,0
make object collision box 1,-25,-35,-25,25,35,25,0
set object specular 1,0
xrotate object 1,270
fix object pivot 1
rotate object 1,0,180,0
rem Walls
rem North Wall
make object box 2,2000,1000,10
rotate object 2,0,0,0
position object 2, 0,500,1005
texture object 2,2
rem East Wall
make object box 3,2000,1000,10
rotate object 3,0,90,0
position object 3, 1005,500,0
texture object 3,3
rem North Wall
make object box 4,2000,1000,10
rotate object 4,0,180,0
position object 4, 0,500,-1005
texture object 4,4
rem West Wall
make object box 5,2000,1000,10
rotate object 5,0,270,0
position object 5, -1005,500,0
texture object 5,5
rem Floor
make object box 6,2000,1000,2000 : position object 6,0,-500,0 : color object 6,rgb(255,255,0)
make object collision box 6,-1000,-500,-1000,1000,500,1000,0
texture object 6,6 : scale object texture 6,50,50
rem Steps
for t=0 to 5
make object box t+7,50,10,50
position object t+7,0,5+(t*20),100+(t*100)
color object t+7,rgb(100,200,100)
make object collision box t+7,-25,-5,-25,25,5,25,0
next t
REM LOAD MODELS
REM SET COLLISIONS
REM SET CAMERA
REM SPECIAL EFFECTS
REM REFRESH SCREEN
sync
REM *** MAIN SECTION LOOP
do
if scancode()=0 then exit
loop
do
REM SPECIAL EFFECTS
REM OBJECT ORIENTATIONS
P1X# = object position X(1)
P1Y# = object position Y(1)
P1Z# = object position Z(1)
A1X = object angle X(1)
A1Y = object angle Y(1)
A1Z = object angle Z(1)
REM CAMERA ORIENTATIONS
cpX# = camera position X()
cpY# = camera position Y()
cpZ# = camera position Z()
caX# = camera angle X()
caY# = camera angle Y()
caZ# = camera angle Z()
REM LIVE SCREEN DISPLAY
ink rgb(255,255,0),0 : set text size 16 : set text to bold : set text transparent
center text 320,420,\\\\\\\"Use your arrow keys to move.Use the spacebar to jump.\\\\\\\"
center text 320,440,\\\\\\\"Press \\\\\\\'Q\\\\\\\' to exit.\\\\\\\"
set cursor 0,0
print \\\\\\\"Seconds Left: \\\\\\\";(MyTimer/60)+1
Rem at 60 frames a second, every timer countdown is 1/60th of a second,
Rem so this will display the time left as whole seconds
set cursor 0,20
REM CONTROL INPUT
if Spacekey()=1 and MyAcceleration# = 0.0 : rem Make sure I\\\\\\\'ve fully landed before I can jump again
P1Y# = P1Y# - Gravity# : rem Look below me
position object 1, P1X#,P1Y#,P1Z# : rem Feel below me
for t = 6 to 12
if object collision(1,t)>0 : rem If feel a solid object below me
MyAcceleration# = MyPower : rem Prepare to jump!
endif
next t
P1Y# = P1Y# + Gravity# : rem Look up
position object 1, P1X#,P1Y#,P1Z# : rem Move back
endif
if Upkey()=1 then move object 1,MySpeed
if Downkey()=1 then move object 1,0-MySpeed
if Leftkey()=1 then A1Y = wrapvalue(A1Y-(MySpeed/3))
if Rightkey()=1 then A1Y = wrapvalue(A1Y+(MySpeed/3))
if Inkey$()=\\\\\\\"q\\\\\\\"
for x = 1 to 100
if object exist(x) = 1 then delete object x
next x
backdrop off
gosub EndSection
endif
Thanks a bunch!
-Cek