-
Please help!
I'm working on a game and so far I have one issue. I want the canon to shoot the red ball in the direction/angle of the canon (where it's pointing). I'm using pinball movement for the red ball,.because I want it have an arc. I have the speed of the red ball set by a counter. It doesn't matter where I have the canon pointed,.it still shoots at one angle (direction) and that I don't want. I just can't get it. Use left mouse to set the speed of the red ball and right to launch it. Set the counter over 40 or 50 before clicking right mouse to launch it. I would like the red ball to launch at the angle from the canon,.the lower the canon angle is, the lesser of an angle and so on. Oh a good example would be the way Angry Birds are launched. That is exactly what I would like this to do.
You'll see what I mean in the example. Please help!
Thank you,
John
http://www.mediafire.com/?u0k31ka4g6e1wd8
-
1 Attachment(s)
I cannot open that file, but I think I know the solution to your problem.
If you set the actual direction of the cannon, simply set the ball to its direction. If you set the angle of the cannon, you need to convert the angle to a direction first. You can use the Clickteam Movement Controller for this (It's actually an easy calculation, but I always use the CMC for this). Simply create the ball and set it's direction to the cannon's direction (converted from its angle).
I attached an example.
-
Thanks Popcorn,.that was perfect. I don't know why you couldn't open my example,.but you nailed the issue! Thanks again man!!
-
No problem, Smanman, I am glad that was what you were looking for :)
-
Angles deal in 0 to 360, and Directions deal in 0-32, so all you need to do to get an angle from a direction is multiply by 11.25, or divide by 11.25 to get a direction from an angle.
-
Hey Smanman. I couldn't view your example because the one you posted was the BACKUP file. it was .001 extension. Remember to post the .mfa ;)
Looks like Popcorn beat me to it!
-
The backup file can have its extension changed to .mfa to be opened, or you can open it from MMF2 without changing the extension. ;)