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 / object movement in dbp

Author
Message
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 23rd Aug 2005 06:38
When I was using the dbc demo I made a program where a sphere was moved with the arow keys. I am trying to do the same with dbp.
For some reason the move object command isn't moving my sphere.
Can someone tell me what I'm doing wrong and tell me how to fix it?

Here is the code:
warship45
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location: uk
Posted: 23rd Aug 2005 12:08
hi,
i found out what the few bug was and that was the u position the object 1 after you have moved the object so the object will never move aprt from left to right. so to fix this u should put this line in under the if spacekey()=1
x=object position x(1)
y=object position y(1)
z=object position z(1)
if yvel>0
position object 1,x,y+yvel,z
endif

or just copy my code from below




you still need to do a bit of work on the jupping the ball but hey i can not do it all for u.

hoped this help if u have any more questions email me or somthing

lone land the rpg
web site coming soon
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 24th Aug 2005 00:29
Thanks for your help. I fixed the movement problems. The jump isn't great, it just sort of skips up, but I am going to fix that later.
How can a make the camera stay behind the sphere?

Here is the new code:

warship45
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location: uk
Posted: 24th Aug 2005 19:31
why do u not use set camera to follow? it will be easyer than a long forula.

lone land the rpg
web site coming soon
2122
19
Years of Service
User Offline
Joined: 15th Aug 2005
Location:
Posted: 25th Aug 2005 00:21
Because the camera in camera follow is too "loose". I tried it, and when you move forward from a stop the camera falls way back and slowly catches up. When you move back the ball goes behind the camera for a second the catches up. I almost fixed the camera though. The only problem now is that when you land on the box, the camera falls to ground level, and the sphere stays on the box like it's supposed to.

Here's the new code:

Login to post a reply

Server time is: 2024-11-27 18:39:05
Your offset time is: 2024-11-27 18:39:05