Quote: "could u tell me what is wrong with this code?"
You've done some indenting, but not enough.
One good thing about indenting your code is that 'something is wrong with my ending thingy' errors are a lot easier to spot.
Here's what you posted, but correctly indented:
`and walls around the scene
for t=0 to 1
make object box t+512,10,50000,500
position object t+512,-200+t*400,5,220
color object t+512,rgb((0),(0),(0))
make object collision box t+512,-5,-20,-250,5,20,250,0
make object box t+514,400,50000,10
position object t+514,0,5,-30+t*500
color object t+514,rgb((0),(0),(0))
make object collision box t+514,-200,-20,-5,200,20,5,0
next t
return: Rem <<<<<<<<<<<<<< Return From What???
if object collision( 1, 483 ) = 1: Re, <<<<<<<<<<<<<< Has No Endif
if object hit(1,484)
For A = 483 to 511
Delete Object A
Next A
endif
gosub _level2
`level 2
_level2:
`the floor
make object box 100,1000,10,1000
position object 100,0,-20,0
color object 100,rgb((0),(0),(0))
make object collision box 100,-500,-5,-500,500,5,500,0
rem Create fog (if supported)
fog on
fog color 0
fog distance 100
`some boxes and platforms
for t=502 to 507
make object box t,20,5,20
position object t,-100+(t-502)*35,-5+(t-502)*3,100
color object t,rgb((255),(255),(255))
make object collision box t,-10,-2.5,-10,10,2.5,10,0
next t
return
You might not have posted all the code, but you've a stray return in there.
You really shouldn't intermix code between procedures or functions either. For example the following code appears to between two procedures:
if object collision( 1, 483 ) = 1
if object hit(1,484)
For A = 483 to 511
Delete Object A
Next A
endif
Notice that the first If statement has no Endif.
Instead, list all procedures and functions at the
end of your program.
In fact, looking more carefully at your code, it does have some more serious layout problems. You are Gosubing to _level2 - which is actually the next executable line! What's that all about?
On return, it will simply execute the procedure again, but have nowhere to return to.
May I suggest that you read parts 1 to 4 of my tutorials for beginners? In particular, part 2 covers the aspects of program layout which will help you avoid the problems you have run into.
(There's a link to the tutorials in the stickies at the top of this board).
I seriously suggest you use the code template from my tutorial and start your program again from scratch - before it gets any bigger and even harder to manage!
TDK_Man