TGC Codebase Backup



Garbage TR by Anonymous Coder

26th Feb 2008 7:54
Summary

Basic-3D program to demonstrate an object movement.



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem **** Garbage TR By Robert Frank **** 
rem set up our garbage truck
load object "GarbageTR.x",1
rem setup ground
load image "rocky13.bmp",1
make matrix 1,2000,1000,20,20
prepare matrix texture 1,1,1,1
randomize matrix 1,150
rem setup sheet of ice
make object box 2,4000,150,4000
rem setup factory
load object "factory.3DS",10
scale object 10,100,100,50
position object 10,50,150,100
hide mouse
position object 1,50,150,100
scale object 1,15000,15000,15000
rotate object 1,0,180,0
fix object pivot 1
rem initiate arrow keys
do
if upkey()=1
x#=object position x(1)+10
z#= object position z(1)
endif
if downkey()=1
x#=object position x(1)-10
z#=object position z(1)
endif
if rightkey()=1
x#=object position x(1)
z#=object position z(1)+10
endif
if leftkey()=1
x#=object position x(1)
z#=object position z(1)-10
endif
y#= get ground height(1,x#,z#)+75
position object 1,x#,y#,z#
rem position camera
position camera 500,500,500
point camera x#,y#,z#
set cursor 0,0
ink rgb(0,0,0),0
print "Use the Arrow Keys for Up-Foward, Down-Backward, Left-Side and Right-Side"
sync
loop