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 / What is wrong with this piece of code?

Author
Message
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 16th Sep 2004 05:28
Quote: "sync on
sync rate 60

backdrop on
color backdrop 0

make matrix 1,5000,5000,70,70

dim players(3,4)

players(1,1) = 50
players(1,2) = 50
players(1,3) = 0
players(1,4) = 0
players(2,1) = 70
players(2,2) = 50
players(2,3) = 0
players(2,4) = 0
players(3,1) = 90
players(3,2) = 50
players(3,3) = 0
players(3,4) = 0


for lp = 1 to 3
load object "models\player.3ds",lp
scale object lp,2500,2500,2500
yrotate object lp,180
fix object pivot lp
next lp

cp = 1

do

for pp = 1 to 3

position object pp,players(pp,1),players(pp,3),players(pp,2)

next pp

set camera to follow players(cp,1),players(cp,3),players(cp,2),players(cp,4),65,50,5,0
point camera players(cp,1),players(cp,3),players(cp,2)
yrotate object cp,players(cp,4)
xrotate camera 30
if upkey() = 1 then players(cp,1) = newxvalue(players(cp,1),players(cp,4),1):players(cp,2) = newzvalue(players(cp,2),players(cp,4),1)
if leftkey() = 1 then players(cp,4) = players(cp,4) - 2
if rightkey() = 1 then players(cp,4) = players(cp,4) + 2
players(cp,4) = wrapvalue(players(cp,4))

sync

loop"


This is the start of my team-play engine, and I can't work out why the player moves strangely .

Use the arrow keys to move him and you will see

Can anyone help? I've been coding for years and have never come across this before

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Sep 2004 05:47
Try rotating the player when you position it, see if that helps. We can't test it properly without the model, but in what way does he move strangely?


Van-B


Muhahahahaha.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 16th Sep 2004 05:51
the arrays aren't floats, and delete this line: xrotate camera 30, because you have already pointed the caemra to something if you want to get the camera pointing a little higher try this : point camera players(cp,1),players(cp,3)+20,players(cp,2)

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 16th Sep 2004 06:59
AH! Thanks a lot dudes

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 21st Sep 2004 06:34
uhh well you can diminish the (non-existent) loading times even more by basically doing:

load object "whatever",1
clone object 1,2
clone object 1,3

or were you supposed to make a mesh out of it or something..
(is there even a clone object command agian?)

ignore me, i'm jibbering. agian.

stupid Monday.

[img src=http://blanky.pt-web.net/ddd.gif] >::p

Login to post a reply

Server time is: 2025-05-24 19:03:59
Your offset time is: 2025-05-24 19:03:59