Computer Science Canada Problem with my animation. |
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 11:49 am ] | ||
Post subject: | Problem with my animation. | ||
I am trying to get user input to create an animation for a oval to fall into that specific place on the x co-ordinate line. The plane made by ovals and the bomb (also an oval) must stay together until the user inputted x coordinate. When that coordinate is reached the oval (bomb) will drop to that x coordinate witha small animation. My problem is that everything except the dropping of the bomb is working. I can get the user input but the most I have been able to do is create an oval at the user inputted coordinate. The basic problem is the oval will be lowered however it is still being smeared onto the bottom because it follows the x for making the plane move. The procedure planebomb has the problem. I want the bomb to simply drop and not move at the x that is inputted. I have tried adding a variable to be similar to the one making the ufo go across the screen however the variable will not allow itself to be manipulated.
I am using Turing version 4.11 |
Author: | BigBear [ Wed Apr 21, 2010 2:34 pm ] | ||
Post subject: | RE:Problem with my animation. | ||
You have the plane and the bomb being drawn separate. You want to draw the bomb under the plane if it has not passed over the yellow oval you have drawn. so if b passes over the bomb draw the yellow otherwise draw it with the plane
look at this section here |
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 3:23 pm ] | ||
Post subject: | Re: Problem with my animation. | ||
New turing working turing code. Now that the bomb is removed from the plane and dropped to it's spot I need assistance with making an "eraser" for the streak the dropping animation causes.
That h variable is for the dropping animation. |
Author: | BigBear [ Wed Apr 21, 2010 5:35 pm ] |
Post subject: | RE:Problem with my animation. |
Why do you even have h if I get rif of that for loop and the -h +h it seems to work fine |
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 6:00 pm ] |
Post subject: | Re: Problem with my animation. |
So how do you make the loop lower the bomb gradually to (num, 20)? |
Author: | BigBear [ Wed Apr 21, 2010 6:36 pm ] |
Post subject: | RE:Problem with my animation. |
you can do that in the same for loop since you want to do both at the same time and not get stuck in one for loop you can make another loop controlled variable h if you want and increment it every iteration |
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 6:40 pm ] |
Post subject: | Re: Problem with my animation. |
Is the loop located within the same procedure as all the drawing? If so, right before or after the if statement? |
Author: | BigBear [ Wed Apr 21, 2010 7:07 pm ] | ||
Post subject: | Re: Problem with my animation. | ||
|
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 7:43 pm ] |
Post subject: | Re: Problem with my animation. |
The loop makes the overall animation neater however, Im trying to achieve a dropping animation similar to the animation of the plane I have. The h is there so that the bomb will drop from it's point to another point when the user number is reached. My problem is that the bomb doesn't stop "bouncing" in its spot. I have created a drawfillbox around the bomb that is the same colour as the background so that the additional copies of the bomb are erased. I don't understand why it is bouncing. |
Author: | BigBear [ Wed Apr 21, 2010 8:10 pm ] |
Post subject: | RE:Problem with my animation. |
You could proceed as usual until the bomb and plane are within a certain amount of pixels ten start to move the bomb down towards the target location. |
Author: | ProgrammingFun [ Wed Apr 21, 2010 8:11 pm ] |
Post subject: | Re: Problem with my animation. |
Polar Bear Hustle @ Wed Apr 21, 2010 7:43 pm wrote: I don't understand why it is bouncing.
You need more explosive and less rubber ![]() Sorry for the completely off-topic post tho. |
Author: | Polar Bear Hustle [ Wed Apr 21, 2010 8:28 pm ] |
Post subject: | Re: Problem with my animation. |
ProgrammingFun @ Wed Apr 21, 2010 8:11 pm wrote: Polar Bear Hustle @ Wed Apr 21, 2010 7:43 pm wrote: I don't understand why it is bouncing.
You need more explosive and less rubber ![]() Sorry for the completely off-topic post tho. Im frequently finding cool effects to add to this program even when I don't want them. Like earlier I found how I could make a giant laserbeam come from my ufo and take out everything as it flies. Not really the point of my game. After removing my "eraser" I don't think it is bouncing as much as the screen is just clipping from all the drawing now I have read a little bit on View.Set things however Im not totally sure where to set the offscreenonly. This is rather irritating considering it seemed so much easier in my head. This bomb just has to have a small animation as the plane flies away. I have the animation however it is just a thick line without the eraser and with the eraser is a flickering bouncing ball. For now I guess it will have to stay bouncing as I will bug my teacher tommorow about it. Thanks for all the help BigBear. |
Author: | BigBear [ Wed Apr 21, 2010 9:16 pm ] |
Post subject: | RE:Problem with my animation. |
If your using offscreenonly you have to put View.Update after you update your animation before you cls and make sure to put it after you put text also with cls you won't need to draw a black spaceship to erase. |