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 / Show coordinates?

Author
Message
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 18th Jul 2010 03:11
say you wanted to make a game, you have your basic player he can move and stuff, and you move him to an area where you want an object to be, instead of just testing and testing is there a way to print (well not print command but show text) of the X,Y,maybe Z coordinates of where your player is?

Thanks!

I want coke, not Pepsi!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 18th Jul 2010 03:46 Edited at: 18th Jul 2010 04:58
I you're using the camera as the player's position, use CAMERA POSITION X/Y/Z, or if it's an object, OBJECT POSITION X/Y/Z.



CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 18th Jul 2010 04:16 Edited at: 18th Jul 2010 04:17
That works but theres alot of #.############### when i move instead of just # its kind of confusing, is there a way to stop this?? Thanks btw

I want coke, not Pepsi!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 18th Jul 2010 04:22
You could use the INT command to round them off.

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 18th Jul 2010 04:24
hm?

I want coke, not Pepsi!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 18th Jul 2010 04:57
INT. It converts float numbers into integers. Type it into DarkBASIC and press F1.

Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 18th Jul 2010 15:03 Edited at: 18th Jul 2010 20:08
i use this



you can change the "object position x/y/z" to camera position x/y/z OR just X# Y# Z# for example.

I can see from your smile, you're not here for the sunset

Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 19th Jul 2010 05:55
Or you can add a number to the STR$() command that will tell it how many decimal places you want.

For example, specifying a 1 like so:



will print up to the tenths place. Writing a 0 would print the number with no decimal places at all.


Guns, cinematics, stealth, items and more!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Jul 2010 06:04
Wow! I never knew that .

TeenCHristian
14
Years of Service
User Offline
Joined: 22nd Jun 2010
Location:
Posted: 17th Aug 2010 16:50
Does anyone know if there is a way to do this with a sprite in a 2D Game?

Learning C++
Proud member of www.codecall.com
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 17th Aug 2010 17:03
Yes, SPRITE X and SPRITE Y

Login to post a reply

Server time is: 2024-09-28 20:22:16
Your offset time is: 2024-09-28 20:22:16