
-----------------------------------
Polar Bear Hustle
Wed Apr 21, 2010 11:49 am

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.



= num then 
%Bomb eraser
drawfillbox ( num-15,h-9, num+15, h+9, 7)
 drawfilloval (num, h, 7, 7, 12) 
%After the num

else 

%bomb bomb 
drawfilloval (b, j - 18, 7, 7, 12) 

end if 
 
end for
    end for
end planebomb


That h variable is for the dropping animation.

-----------------------------------
BigBear
Wed Apr 21, 2010 5:35 pm

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

-----------------------------------
Polar Bear Hustle
Wed Apr 21, 2010 6:00 pm

Re: Problem with my animation.
-----------------------------------
So how do you make the loop lower the bomb gradually to (num, 20)?

-----------------------------------
BigBear
Wed Apr 21, 2010 6:36 pm

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

-----------------------------------
Polar Bear Hustle
Wed Apr 21, 2010 6:40 pm

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?

-----------------------------------
BigBear
Wed Apr 21, 2010 7:07 pm

Re: Problem with my animation.
-----------------------------------
for b : 1 .. 800 %loop starts here
        %Plane Body
        drawfilloval (b, a, 30, 7, 14)
        %Top of plane
        drawfilloval (b, a + 2, 7, 10, 14)


        delay (5)
        %Plane Back part eraser
        drawfillbox (b - 30, a - 30, b + 30, a + 30, 7)


        %If you haven't gone past the num
        if b >= num then
            %Bomb eraser
            drawfillbox (num - 15, 9, num + 15, 9, 7)
            drawfilloval (num, 9, 7, 7, 12)
            %After the num

        else

            %bomb bomb
            drawfilloval (b, j - 18, 7, 7, 12)

        end if


    end for%loop ends here

-----------------------------------
Polar Bear Hustle
Wed Apr 21, 2010 7:43 pm

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.

-----------------------------------
BigBear
Wed Apr 21, 2010 8:10 pm

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.

-----------------------------------
ProgrammingFun
Wed Apr 21, 2010 8:11 pm

Re: Problem with my animation.
-----------------------------------
I don't understand why it is bouncing.

You need more explosive and less rubber  :mrgreen: ...

Sorry for the completely off-topic  post tho.

-----------------------------------
Polar Bear Hustle
Wed Apr 21, 2010 8:28 pm

Re: Problem with my animation.
-----------------------------------
I don't understand why it is bouncing.

You need more explosive and less rubber  :mrgreen: ...

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.

-----------------------------------
BigBear
Wed Apr 21, 2010 9:16 pm

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.
