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 / Need help!

Author
Message
Anonymous
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Australia
Posted: 18th Nov 2002 08:08
I tried to make a player but the player didn't apper. What happened? Heres the code:



Might be I should make the camera follow the player. Could someone tell me how to make the camera follow the camera?
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 18th Nov 2002 09:22
Try this:
rem Set Up Game
Sync On
Sync Rate 0
hide mouse
autocam on

rem Make matrix and texture it
load image "floor1.bmp",1
MAKE MATRIX 1,10000.1,10000.0,25,25
prepare matrix texture 1,1,1,1

rem Make Player
For x = 1 to 5
Make object cube x,100
Position object x,Rnd(200),0,Rnd(200)
Next x

Repeat
If Upkey()=1 then Move object x,10
If Leftkey()=1 then Yrotate object x,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object x,Wrapvalue(aY#+5)
Sync
`-->Some Camera
Until Escapekey()=1
End

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
Anonymous
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Australia
Posted: 19th Nov 2002 07:03
Thanks, but theres a error at line 22, object doesn't exist

Bogboy2000
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 19th Nov 2002 20:14
whens the error appear

try

Repeat
for x = 1 to 5
If Upkey()=1 then Move object x,10
If Leftkey()=1 then Yrotate object x,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object x,Wrapvalue(aY#+5)
next x
Sync
`-->Some Camera
Until Escapekey()=1
End
ToXic
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Australia
Posted: 19th Nov 2002 23:08
Try this, hope it helps.

ToXic


Login to post a reply

Server time is: 2024-03-28 09:27:03
Your offset time is: 2024-03-28 09:27:03