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.

2D All the way! / Sprite Movement

Author
Message
Mel_o_Die
22
Years of Service
User Offline
Joined: 11th Jun 2004
Location:
Posted: 14th Jun 2004 20:55
Hi!
How can i do to make a sprite move from a point A to a point B with mouse click.

We need to "memorize" mouseclick X,Y coordinates, but how to use it and makes move (or fly) the sprite to the destination.

Thanks very much and sorry for my english

-Mel_o_Die-
Mel_o_Die
22
Years of Service
User Offline
Joined: 11th Jun 2004
Location:
Posted: 14th Jun 2004 22:01
Here is my code, just to test moves (i've started coding last 2days)

But I can't find how to simplify that code, and how to make a new move when we click again (take last coordinates XY and restart move to a new end XY(cick))

thanks

-Mel_o_Die-
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jun 2004 23:15
Here is a basic technique - quite simple really. I've added comments to the code to make it easier to follow.



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Mel_o_Die
22
Years of Service
User Offline
Joined: 11th Jun 2004
Location:
Posted: 15th Jun 2004 03:02
Thanks for your code and comments it's cool, i'll examinates that to learn more and the way to uses it.
nice

see you !

-Mel_o_Die-
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 20th Sep 2004 04:07
Thanks IanM, I can use it too.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Sep 2004 02:37
That's why I posted it

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Crazy Programmer
AGK Developer
21
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 26th Sep 2004 12:48
thanks ianm i can use that to lol your a big help thanks alot

crzy programer

Login to post a reply

Server time is: 2026-06-11 17:32:56
Your offset time is: 2026-06-11 17:32:56