Computer Science Canada Mouse Movement |
Author: | upthescale [ Tue May 23, 2006 3:04 pm ] |
Post subject: | Mouse Movement |
Oj thism ight sound hard but i would like to learn it, any ideas? first i got my mouse, and i am using Mouse.Where....i want it so i have a blue ball (or whatever the objecti s) and whne i move my mouse, it will come toward it so it will follo my mouse, so if i move my left to the top corner, the ball will slowly move to the top corner...what shud i learn to do this? |
Author: | TheOneTrueGod [ Tue May 23, 2006 3:09 pm ] |
Post subject: | |
You allready know everything you need to do that... All you have to do is apply logic. Think about the problem, DON'T post here every minor problem you have, try some debugging on your own first, and the answer to your question is actually within the question itself. |
Author: | upthescale [ Tue May 23, 2006 3:11 pm ] |
Post subject: | |
setscreen ("offscreenonly") var x, y, b : int loop mousewhere (x, y, b) cls drawfilloval (x, y, 10, 10, 7) delay (45) View.Update end loop i have that so far, but i dont want a delay !! ther is an easier whay but i haven o clue, this is my 3rd day OneTrueGod trying to do this lol |
Author: | Cervantes [ Tue May 23, 2006 3:23 pm ] |
Post subject: | |
You know all the Turing you need to do this. The part you might not know is the math behind it. You'll need to know Trigonometry. You'll need to be able to determine the angle between two points (arctan), then use SOHCAHTOA (well, mostly just SOHCAH...) to update the position of each ball. |
Author: | upthescale [ Tue May 23, 2006 3:34 pm ] |
Post subject: | |
i got 90 in trig...ui no trig just i cant apply it in turnig i dont no where t put the X and Y and () and stuff liek that |
Author: | Cervantes [ Tue May 23, 2006 3:46 pm ] |
Post subject: | |
Here's the battle plan:
|
Author: | upthescale [ Tue May 23, 2006 4:06 pm ] | ||
Post subject: | |||
is this ok? the hit detection is off
|
Author: | Clayton [ Tue May 23, 2006 4:25 pm ] |
Post subject: | |
you know the funny thing upthescale, you are a fairly good programmer when you actually put your mind to it, all you have to learn to do is sit down and think about what you want to do before you run to the keyboard and type up what you want to do |
Author: | upthescale [ Tue May 23, 2006 4:30 pm ] |
Post subject: | |
i may be good but 1-i can program fine, just i dont no wut alot of the stuff means 2- i copied that fum turing help and changed it up alot, by adding bouncing balls, the shape of the mosuewhere figure, and the speed |
Author: | MysticVegeta [ Tue May 23, 2006 7:11 pm ] |
Post subject: | |
if you are making a game in which there are obstructions like walls or something then the shortest route for the ball that is catching up to the original one wont be using trig ratios, you would have to use dfs or bfs algorithm for the shortest path. |
Author: | Cervantes [ Tue May 23, 2006 8:17 pm ] |
Post subject: | |
MysticVegeta wrote: you would have to use dfs or bfs algorithm for the shortest path.
That's, "Depth First Search" and "Breadth First Search". MysticVegeta, the point of posting in the help forum is not to show off, it's to offer help. To that end, it's a good idea to define acronyms. ![]() |