TGC Codebase Backup



move cube by super skull

29th May 2004 12:40
Summary

this program gives you complete controll over an object



Description

i am a complete amature and i hope thi code works if any one can help me my email address is asknick2000@yahoo.com.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    sync on
sync rate 100
rem print move the object
print "move the cube"
`make object cube
make object cube 1,5
color object 1,(255,255,255)
`make player variables
dim playerx(1) = 12
dim playery(1) = 12
do
`position player
position object 1,playerx(1),playery(1),10
`function to move up
function playerup()
inc playery(1),2
end function playerup()
`function to move player down
function playerdown()
dec playery(1),2
endfunction playerdown()
`move player right
function playerright()
inc playerx(1),2
endfunction playerright()
`move player left
function playerleft()
dec playerx(1),2
end function playerleft()
playerkey = scancode()
`if commands
if playerkey=200 the playerup()
if playerkey=208 then playerdown()
if playerkey=205 then playerright()
if playerkey=203 then playerleft()
sync
loop