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 Professional Discussion / (DBPRO) pointsprite() and pointsprite2pos functions

Author
Message
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 21st Oct 2018 11:55
This is, much probably, something that many people were looking for.

First snippet is the function that point sprite 1 towards sprite 2. Same as Point Object, but in 2D something they could have added in DBPRO by default, but didn't for some reason.



And this one points the sprite towards a given x and y position. Quite like the other function, but just needs one sprite and 2 coordinates.




This time, I believe I was of some help. I've seen people asking how to find the angle between two sprites - much probably to point one to another - and now, finally, this is possible in 2D in the same way as it is in 3D.

Thanks to @Mage who gave me the inspiration that made this functions possible.
[size=+2]Forever and one[/size]
LBFN
16
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 22nd Oct 2018 16:32
Thank you! This should come in handy.



So many games to code.....so little time.
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 23rd Oct 2018 00:56 Edited at: 23rd Oct 2018 00:57
You're welcome.

It is incredible to think that DBPro exists since more than a decade ago and no one came with a function to perform such a simple action.

At least you'll be able to tell your friends that for the first time in almost a century a Brazilian solved a problem instead of causing it.

By the way, I am now focused on 2D. If there is something you need regarding 2D games, just ask and if I can help, I'd be glad to.
[size=+2]Forever and one[/size]

Login to post a reply

Server time is: 2024-03-29 12:00:06
Your offset time is: 2024-03-29 12:00:06