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 / pls tell me why my movement is rubbish

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 20th Sep 2004 01:53
right ive been working at this for ages i loaded a .x level from cshop and got it to make me walk on the level by positioning the camera at the level height every time you move here is my code if u know pls tell me

current projects
codename : tasgarad and discworld mysteries
life in the city watch
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 23rd Sep 2004 14:45
In this part of the code:


It helps not to use MOVE CAMERA because then you could go up or down or wherever, using a combination of newxvalue, newzvalue, and position camera produces a much crisper effect.

Also right here:



Try using WRAPVALUE instead of CURVEVALUE

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 25th Sep 2004 07:46
it works fine when i use up down left and right, but not with 'w a s d'

current projects
codename : tasgarad and discworld mysteries
life in the city watch
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 25th Sep 2004 08:34 Edited at: 25th Sep 2004 08:36
Oh okay....

The reason is, the inkey$() code doesn't test the keyboard the same way as upkey() for example. Inkey$() actually waits for the "key down" bit on the keyboard communication line, which gets repeated at about 8 times a second when you hold the button down on the average keyboard. (The typematic setting in bios.)

What you want to use is scancode() instead, and use the the values for the keys you've selected, which will act like the upkey() command in normal operation. This link, if it still works, points to the graphic of the scan codes for each key.

http://forum.thegamecreators.com/?m=forum_view&t=33640&b=7

That should solve the jerking problem...
Good luck,
S.

Any truly great code should be indisguishable from magic.
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 26th Sep 2004 19:51
okay i have used the scancode thing but its now worse i think i put if scancode()=17 or somthing like that is that right

current projects
codename : tasgarad and discworld mysteries
life in the city watch
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 27th Sep 2004 03:28 Edited at: 27th Sep 2004 04:37
yes, that's right. if scancode()=17 or if keystate(17)=1. yet another way is to say a = scancode() and follow it with if a=17.
good luck!

(keystate() is another simiar operation.)

Any truly great code should be indisguishable from magic.
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 27th Sep 2004 09:38
It is much better to use "if keystate(17)=1" because it will allow you to hold many keys down at once. Don't use "if scancode()=17".

Xander Moser - Bolt Software - Firewall

Login to post a reply

Server time is: 2025-05-24 17:34:50
Your offset time is: 2025-05-24 17:34:50