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.

DarkBASIC Discussion / quick help

Author
Message
d carlberg12
19
Years of Service
User Offline
Joined: 6th Mar 2007
Location:
Posted: 7th Mar 2007 04:39
I need help creating walls and a floor so i have barriers relative to the object created ive tried a couple things but deleted everything for that i just cant get it to run correctly i think im looping it wrong possibly? so if anyone can help plz!!!




Rem random things
Hide Mouse
player = 1
autocam on
sync on : sync rate 60

Rem Object Creation
Make Object Sphere player,75
Make Object Cone 2,100
Make Object Cone 3,100
Make Object Cube 4,100

Rem Object Color
Color object player, rgb(0,0,0)
Color object 2, rgb(255,255,255)
Color object 3, rgb(255,255,255)
Color Object 4, rgb(255,255,255)

Rem Object Position
Position Object 2, -200,0,200
Position Object 3, 200,0,200
position object 4, 0,0,500

Rem Collision with Objects
set object collision on player
make object collision box 1, -42,-42,-42, 42,42,42, 0
set object collision on 2
make object collision box 2, -30,-30,-30, 30,30,30, 0
set object collision on 3
make object collision box 3, -30,-30,-30, 30,30,30, 0
set object collision on 4
make object collision box 4, -42,-42,-42, 42,42,42, 0
sync
Rem Object Movement
Do
x# = object position x(player)
y# = object position y(player)
NewY# = y#+10
OtherY# = y#-10
z# = object position z(player)
aY# = object angle Y(player)

if upkey() = 1 then move object player, 10
if downkey() = 1 then move object player, -10
if rightkey() = 1 then yrotate object player, wrapvalue(aY#+7)
if leftkey() = 1 then yrotate object player, wrapvalue(aY#-7)
if Inkey$()= "w" then position object player, x#, newy#, z#
if Inkey$()= "s" then position object player, x#, othery#, z#

Rem Camera Movement Follow
cpZ# = Newzvalue(object position Z(player), object angle Y(player)-180,300)
cpX# = Newxvalue(object position X(player), object angle Y(player)-180,300)
position camera cpX#,150,cpZ#
Point camera object position X(player), object position y(player)+50,object position z(player)
sync
Loop
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Mar 2007 02:10 Edited at: 8th Mar 2007 02:12
Hello d,

I don't understand what you're asking for. If you want to add walls, use MAKE OBJECT PLAIN or MAKE OBJECT BOX and adjust them to the proper dimensions. You can add a floor with MAKE MATRIX or MAKE OBJECT PLAIN and rotate the plain on the x axis. Your code seems to run ok.

And also edit your message, highlight the code, and press the CODE button so that it puts it all in a nice neat box so it doesn't make your message larger than it has to be like this:



Enjoy your day.

Login to post a reply

Server time is: 2026-07-06 12:12:03
Your offset time is: 2026-07-06 12:12:03