Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / !!!! NEWBIE !!!! MOVING LEFT OR RIGHT

Author
Message
wanderer
20
Years of Service
User Offline
Joined: 17th Feb 2004
Location: vampire temple
Posted: 6th Mar 2004 16:31
i am creating my first game with DARKBASIC CLASSIC and it is going to be a puzzle game.
i can move the boxes up and down and craete up and down boundarys, but how do i move them left and right without ROTATING them? and create left and right boundarys after that?

PLEASE HELP

HERES MY CODE:

666
wanderer
20
Years of Service
User Offline
Joined: 17th Feb 2004
Location: vampire temple
Posted: 6th Mar 2004 16:36
`turn syncronise on and set it to 40
sync on
sync rate 40

`make the first box and color it
make object box 1,1,1,1
color object 1,rgb(255,0,255)
`make the second box and color it
make object box 2,1,1,1
color object 2,rgb(100,150,100)

`-------------------------------------------------------------------------------------------------------------------------------------------------------------
` MAIN LOOP
`-------------------------------------------------------------------------------------------------------------------------------------------------------------
`start the main loop
do
`position the objects and cameras and point the camera
position object 1,-5,0,1p#
position object 2,5,0,2p#
position camera 0,10,-10
point camera 0,0,0
`set the contols for the boxes
if upkey()=1 then 1p#=1p#+0.5
if downkey()=1 then 1p#=1p#-0.5
if keystate(31)=1 then 2p#=2p#-0.5
if keystate(17)=1 then 2p#=2p#+0.5
`make the boundarys of the movement area
if 1p#<-6 then 1p#=-6
if 1p#>6 then 1p#=6
if 2p#<-6 then 2p#=-6
if 2p#>6 then 2p#=6
`syncronise and loop
sync:loop

666
wanderer
20
Years of Service
User Offline
Joined: 17th Feb 2004
Location: vampire temple
Posted: 6th Mar 2004 16:37
the above message is my code, please help

666
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 6th Mar 2004 16:49
First of all, your code was already on your first post, didnt need to post the whole thing again. Its in that little bar under your post that says "source". Speaking of which, here is your fixed code.

Hope this helps.

-Vash the Stampede

Intel Pentium 4 3.0 Ghz 1024MB Ram NVIDIA GeForceFX 5200 128MB 19" LCD DVI Viewsonic

wanderer
20
Years of Service
User Offline
Joined: 17th Feb 2004
Location: vampire temple
Posted: 6th Mar 2004 16:56
Thankyou very much, your code worked! Now i Can get onto more complex things!

666

Login to post a reply

Server time is: 2024-11-26 07:53:20
Your offset time is: 2024-11-26 07:53:20