look at this code
Sync on
hide mouse
sync rate 32
make object sphere 1,10
make object sphere 5,2
set object collision off 5
make object sphere 4,2
set object collision off 4
color object 4, RGB(0,0,0)
color object 5, RGB(0,0,0)
color object 1, RGB(247,252,44)
set object collision to spheres 1
rem antennea
make object sphere 101,3
make object sphere 102,3
make object sphere 103,3
make object sphere 104,3
for i = 101 to 104
hide object i
set object collision to spheres i
next i
Load image "steel.bmp",1
make matrix 1, 175, 175, 8, 8
Prepare matrix texture 1,1,1,1
Fill Matrix 1,0,1
X# = 87
Z# = 87
PrevX# = 87
PrevZ# = 87
position object 1,87,get ground height(1, 87, 87),87
rem make level
gosub makelevel
do
rem no diagnal move
gosub diagnal
if object collision(101, 0) then GoingDown = 0
if object collision(102, 0) then GoingLeft = 0
if object collision(103, 0) then GoingRight = 0
if object collision(104, 0) then GoingUp = 0
rem eyes move-----------------------
if goingup=1 then zi#=z#+1 : xi#=x#+1
if goingdown=1 then zi#=z#-1 : xi#=x#-1
if goingright=1 then xi#=x#+1 : zi#=z#+1
if goingleft=1 then xi#=x#-1 : zi#=z#-1
if goingup=1 then zi1#=z#+1 : xi1#=x#-1
if goingdown=1 then zi1#=z#-1 : xi1#=x#+1
if goingright=1 then xi1#=x#+1 : zi1#=z#-1
if goingleft=1 then xi1#=x#-1 : zi1#=z#+1
`rem changes values to new positions--------------------
if GoingRight = 1 and X# < 167 then X# = X# + 1
if GoingLeft = 1 and X# > 6 then X# = X# - 1
if GoingUp = 1 and Z# < 167 then Z# = Z# + 1
if GoingDown = 1 and Z# > 7 then Z# = Z# -1
Position object 101,X#, get ground height(1, X#, Z#), Z#-7
Position object 102,X#-7, get ground height(1, X#, Z#), Z#
Position object 103,X#+7, get ground height(1, X#, Z#), Z#
Position object 104,X#, get ground height(1, X#, Z#), Z#+7
Position object 1,X#, get ground height(1, X#, Z#), Z#
position object 5,xi#, get ground height(1,xi#,zi#)+4.5,zi#
position object 4,xi1#, get ground height(1,xi#,zi#)+4.5,zi1#
Sync
loop
diagnal:
REM Check to see if we're pressing up, and nothing else.
if Upkey()=1 or joystick up()=1 and Downkey()=0 and Leftkey()=0 and Rightkey()=0 and Z# < 170
REM Set variables to show we're going up and nowhere else.
GoingUp = 1
GoingDown = 0
GoingLeft = 0
GoingRight = 0
endif
REM Check to see if we're pressing down, and nothing else.
if Downkey()=1 or joystick down()=1 and Upkey()=0 and Leftkey()=0 and Rightkey()=0 and Z# > 5
REM Set variables to show we're going down.
GoingDown = 1
GoingUp = 0
GoingLeft = 0
GoingRight = 0
endif
REM Check to see if we're pressing left, and nothing else.
if Leftkey()=1 or joystick left()=1 and Downkey()=0 and Upkey()=0 and Rightkey()=0 and X# > 5
REM Set variables to show we're going left, and nothing else.
GoingLeft = 1
GoingRight = 0
GoingUp = 0
GoingDown = 0
endif
REM Check to see if we're pressing right and nothing else.
if Rightkey()=1 or joystick right()=1 and Downkey()=0 and Leftkey()=0 and Upkey()=0 and X# < 170
REM Set variables to show that we're going right and nothing else.
GoingRight = 1
GoingLeft = 0
GoingDown = 0
GoingUp = 0
endif
return
makelevel:
rem sides
rem right
make object box 7,5,8,85
position object 7,171,get ground height(1, 171, 45),45
make object box 8,5,8,75
position object 8,171,get ground height(1, 171, 135),135
rem left
make object box 9,5,8,85
position object 9,2,get ground height(1, 2, 45),45
make object box 10,5,8,75
position object 10,2,get ground height(1, 2, 135),135
rem bottom
make object box 11,167,8,5
position object 11,85,get ground height(1, 85, 5),5
rem top
make object box 12,167,8,5
position object 12,85,get ground height(1, 85, 170),170
rem inside top boxes
make object box 13,5,8,35
position object 13,87,get ground height(1, 85, 150),150
make object cube 14,20
position object 14,113,get ground height(1, 113, 143)-5,143
make object cube 15,20
position object 15,145,get ground height(1, 145, 143)-5,143
make object cube 16,20
position object 16,61,get ground height(1, 61, 143)-5,143
make object cube 17,20
position object 17,29,get ground height(1, 29, 143)-5,143
rem second boxes down
make object box 18,20,7,10
position object 18,29,get ground height(1, 29, 117),117
make object box 19,30,7,10
position object 19,87,get ground height(1, 87, 117),117
make object box 20,20,7,10
position object 20,145,get ground height(1, 29, 145),117
rem side boxes
make object box 21,39,10,4
position object 21,20,get ground height(1, 22, 99),99
make object box 22,39,10,4
position object 22,153,get ground height(1, 155, 99),99
make object box 23,39,10,4
position object 23,20,get ground height(1, 20, 86),86
make object box 24,39,10,4
position object 24,153,get ground height(1, 153, 86),86
rem inside hard stuff
make object box 25,4,10,39
position object 25,53,get ground height(1, 53, 99),99
make object box 26,4,10,39
position object 26,121,get ground height(1, 121, 99),99
make object box 27,5,8,10
position object 27,87,get ground height(1, 87, 117),110
`for i= 7 to 72
`color object i,rgb(255,0,0)
`next i
`for i=7 to 72
`set object collision to boxes i
`next i
position camera 87, 150, 87
point camera 87,0,87
return
please dont make fun of my spelling,or sentence structure.Id rather study math or programming