Computer Science Canada Help me with a mouse to graphic problem |
Author: | Vertico [ Wed Apr 13, 2005 4:04 pm ] |
Post subject: | Help me with a mouse to graphic problem |
i just would like to know how i could do it so that if i click somewhere on the screen with the mouse that an oval from the bottom corner will shoot out to that spot and stop there i know to use Mouse.Where(mx,my,button) to get the x/y cordinates but i dont know how 2 get an oval from the bottom 2 go there and stop when it gets there |
Author: | Delos [ Wed Apr 13, 2005 5:22 pm ] |
Post subject: | |
@possibility Yes. Very much so. @how to do it If you know anything about vectors from physics, this should be no problem to do if you keep thinking along those lines. If not, think about a triangle from the bottom of the screen to the point (w/ the x & y axes being the opp. and adj. sides, and the connecting line being the hyp.). Now, think about movement as having a x- and y- componenet, and work from there. Try this out first, if you get stuck repost, I'm sure someone will be able to give you a better explanation of vectors. If you're really in a hurry, check out any of the many particle engines lying around. They have the basic concepts in there, you'll just need to apply them. |
Author: | Token [ Wed Apr 13, 2005 5:36 pm ] | ||
Post subject: | |||
well if you wanted it to just be simple you could just draw it where you clicked, but if you are doing like Delos said then you'll need somthing like this
its pretty self explanitory if you look at it closely, hope it helps. if you have any more questions just ask. and you should check the tutorials for help, thats how i learned |
Author: | Vertico [ Wed Apr 13, 2005 5:53 pm ] | ||
Post subject: | |||
got this error when i tryed running the program u had. Also u mentioned tutorial. can u give me the link to that. i tryed looking for it but could not find it. |
Author: | Token [ Wed Apr 13, 2005 6:02 pm ] |
Post subject: | |
Ummm, you need to update turing, or make it so that it finds the distance between those two points. |
Author: | Martin [ Wed Apr 13, 2005 6:06 pm ] | ||
Post subject: | |||
|
Author: | Vertico [ Sun Apr 17, 2005 4:42 pm ] |
Post subject: | |
i have another idea/problem. mostly i am wondering if its possible to have a "bullet" come from both ends of the bottom of the screen and come up to meet at the point clicked by the mouse. but meet there at the same time so 1 "bullet" coming from the bottom left corner of the screen, and 1 "bullet coming from the bottom right corner meeting at the spot were the mouse was clicked. so if the mouse cordinates was closer to the one on the left then the "bullet" coming from the right has 2 speed up so they both get there at the same time. is this possible? and if so how do u exactly do this? |