TGC Codebase Backup



3D object control by The Nerd

21st Nov 2004 9:43
Summary

this is an easy way to make a control for a 3D cube



Description

This code show you how to make a simple control for a 3D object, fell free to use the code in you game or you program you could ETC use it to a pong game.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    ` This code is made by : The Nerd

` make the sync setup

sync on
sync rate 30

` make the 3D object

make object box 1,1,1,3

` color the box

color object 1, RGB(0,255,0)

` *THIS IS THE START ON THE MAIN LOOP*

do

` positon the 3D box and make in a variable

position object 1,0,0, player#

` This is the control input

if upkey() =1 then player#=player#+5.0
if downkey() =1 then player#=player#-5.0

` *position the camera*

position camera 0,10,-10:point camera 0,0,0

sync
loop