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.

Author
Message
Eman212
20
Years of Service
User Offline
Joined: 6th Mar 2004
Location:
Posted: 7th Mar 2004 01:57 Edited at: 7th Mar 2004 02:09
HI it's my first post here and I'm pretty new to Dark Basic but I find it's awesome I just need to practice I guess. Ok I need help on something I got this little guy who can move from

http://omargames.ifrance.com/omargames/

Go there and click on downloads and then get PERSONNE and PERSONNETEX zips

Oh and this is for db I'm not sure if it works for pro
I tried to make him jump using w which is keystate(17)
adding the following line to modify the position of the object

if keystate(17)=1 then y#=NEWYVALUE(5,a#,z#) : z#=NEWZVALUE(z#,a#,2) : stage=1

but instead of jumping when I press w the camera is following the guy when he walks sideways

here's the modified code


Can someone please help? I have a hard time with variables
Eman212
20
Years of Service
User Offline
Joined: 6th Mar 2004
Location:
Posted: 7th Mar 2004 04:50
ok I modified it a little bit and got him moving up the screen but I wonder how to make him fall again lol anyway if you can help a little it would be really appreciated

Don Malone
21
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 7th Mar 2004 14:45
When you have a charater jump as you did you use the code


You will need to add some code to your game loop that checks your charaters position above the ground or y# = 0.

Most people use 0.1 as the negative (or fall value) but you can adjust that to your games needs. If you were doing a big fall you may choose to add to the value to make a character fall faster as more time passes but that is a little off topic.

so I guess you are looking for something like


You would/could also check to make sure that your character is close enough to the ground to actually jump by checking y# versus the ground height before addind to y#

For checking ground height of an .X modeled map here is a link to check
http://darkbasic.thegamecreators.com/?m=forum_view&t=25480&b=10

and here is the one of the shortest threads for use of Get Ground Height
http://darkbasic.thegamecreators.com/?m=forum_view&t=21798&b=10

I am no pro by a long shot but I hope I was able to help.

Don

Wasting CPU Cycles since the 286 was a hot machine.
Eman212
20
Years of Service
User Offline
Joined: 6th Mar 2004
Location:
Posted: 8th Mar 2004 05:14
Thank you I'm going to try that.

Login to post a reply

Server time is: 2024-11-26 07:36:49
Your offset time is: 2024-11-26 07:36:49