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 / Moving Object with mouse?

Author
Message
SilverKnight
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location:
Posted: 22nd Sep 2003 04:58
Hey Guys!

Im trying to move an object with the mouse. What i want is to be able to click on the terrain and have my object move to where i clicked, like in diablo 2, or baldurs gate. if anyone could point me in the right direction, or show me some example code to get me started i would be greatful! Thanks!

Regards,
Rajavidya SilverKnight
Ralen
23
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 22nd Sep 2003 10:00
Is this for a 2d game, or a 3d game?
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Sep 2003 11:09
To select a character, you could write a function using object screen x() and object screen y(). Or there's the new pick object command in DBP. If you're moving your character across a flat ground, you could take the sub routine from my rts demo. (code snippet section) If its a randomized matrix, or otherwise uneven ground, there's a snippet from dmitry on that. I've implemented his code into my rts now, but i haven't posted the update yet.
SilverKnight
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location:
Posted: 22nd Sep 2003 19:43
Ralen: This is for a 3D game.

Phaelax: Thanks! I will look at both of them!

Regards,
Rajavidya SilverKnight

Login to post a reply

Server time is: 2026-07-25 05:32:37
Your offset time is: 2026-07-25 05:32:37