
-----------------------------------
TheBoyWhoTried
Fri Dec 04, 2015 12:54 pm

Animation
-----------------------------------
Okay I've been struggling for the past two weeks to learn how to animate. I haven't found anything to help me. I've asked so many different things so many times and have gotten answers that kinda beat around the bush. i'm kinda losing my patience here because i just really need help. So here it is, I have no idea whatsoever how to animate and I need help. I need to be taught how to animate in general and not that messy 'making the image the same colour as background" stuff to make it seem like it's being animated. Someone please teach me how to animate. Start from the most basic stuff. Give me a crash course. Please, I so desperately need help. Teach me how to animate in Turing.

-----------------------------------
TokenHerbz
Fri Dec 04, 2015 2:21 pm

RE:Animation
-----------------------------------
Your questions are always generic.

To animate is essentially displaying one frame at a time of what you want to visually see.  It could be anything where the pictures on the screen change.  Again your updating this, one frame at a time.

You were given multiple sources of information to accomplish this, any maybe if you posted some code or something to show us which parts or issues you are having then we could assist further.

We don't know many things, are you using pictures? sprites? are you using just basic gui shapes.

Are you having problems updating the frames? what is your goal of the animation your trying to accomplish?

The steps are:
1) create your frame (the point of which you want displayed)
2) update to display it

I made this example, with comments, is this what your looking for?  The same concept applies for most things.
[code]
View.Set ("offscreenonly") %%we should use this for graphical because
                                %%it prevents the RUN Window from being UPDATE
                                %% until the View.Update is called.

var ballvx : int := 2 %%ball x velocity                                
var ballx : int := 50 %%ball x location
var ballsize : int := 20
                                
loop

    cls %%i like to clear the screen before creating a frame to show
    
    %%lets build a frame
    
    %%I'll start with some background that changes colors depending on 
    %%where the ball is, which will be moved automatically back and fourth
    
    if ballx + ballsize >= round(maxx/2) then
        Draw.FillBox(0,0,round(maxx / 2), maxy, yellow)
        Draw.FillBox(round(maxx / 2), 0, maxx, maxy, blue)
    else
        Draw.FillBox(0,0,round(maxx / 2), maxy, blue)
        Draw.FillBox(round(maxx / 2), 0, maxx, maxy, yellow)
    end if

    %%move the ball
    ballx += ballvx
    
    %%rough boundries to handle ball
    if ballx + ballsize >= maxx or ballx = maxx or ballx  maxx then x := 0
end if if d then y += vy if y = maxy - 50 then d := true end if
end if mx -= ms if mx = maxx then t -= 1 if t = 0 then ms := 0 end if ms *= -1 end if
Draw.FillBox(0,maxy,maxx,maxy-250,blue) Draw.FillBox(200,40,190,210,brown) Draw.FillOval(200,190,20,20,green)
Draw.FillOval(180,220,25,25,green) Draw.FillOval(220,220,25,25,green)Draw.FillOval(50,maxy-50,50,50,yellow)
Draw.FillBox(mx,my, mx+20, my+40,7) if ms > 0 then Draw.FillBox(mx,my+40, mx-5, my+80,7) else
Draw.FillBox(mx,my+40, mx+5+20, my+80,7)end if Draw.FillBox(mx,my+40, mx+20, my+80,grey)
Draw.FillOval(x, y, r, r, c) Draw.FillOval(x+20, y+20, r+5, r+5, c) Draw.FillOval(x+40, y-10, r+10, r+10, c)
Draw.FillBox(0,0,maxx,40,green) View.Update() delay(10) end loop
[/code]

-----------------------------------
TheBoyWhoTried
Fri Dec 04, 2015 9:02 pm

Re: Animation
-----------------------------------
I never intended on stealing because that wouldn't help me learn and I want to understand how to do this. You're right in that I don't understand the motion aspect and how to apply the math to it. It just looks like to me that the if statements don't exactky interact even with the drawings. You say that there are no tutorials for animation because it's essentially math, in this case I want to bring this to my teacher and get her to help me understand this better and explain it to me (she doesn't know animation per say but if it is just math...). she is a teacher so maybe i'll be able to learn better. Thanks for the help...i appreciate it.

-----------------------------------
TokenHerbz
Fri Dec 04, 2015 9:54 pm

RE:Animation
-----------------------------------
i would need to draw a picture on paper and show you in person because i struggle with how to intellectually express my thoughts.

But i'll try.

if you have one picture, shape, etc. and you start it off at 0,0 for x,y.

you then apply a motion of adding to those x,y's, say by 5 at a time (frame), then thats making it:

x = x + 5
y = y + 5

and that makes that picture, or object go in an upward right direction respectfully.

if you apply this same process 5 times, that x,y will be located at 25,25 x,y.

its the process of manipulating the objects x,y slightly each frame that gives you that "movement" motion.

you can enforce rules, and structure to those objects, boundrys, you are the boss of what that object can and cant do, or if it can or cant go off the screen or pass some other object.

those rules are logic/math. nothing more that ifs ands ors etc.

before you try to program your application, you want to think "Whats" first.

1) what do i want my object to beable to do, and not do.  implement those rules.
and whichever else implys to this

ex: well if i want to keep my x,y object but for it to stop in the middle horizontal area and come back.

answer: Well where is the middle, maybe maxx/2? so lets make an if statement to handle that.

if x >= maxx/2 then %%its passed the halfway mark, we need to reverse it
    reverse implemented
end if

I hope that makes it a little bit more clear?

-----------------------------------
TokenHerbz
Sat Dec 05, 2015 6:30 am

RE:Animation
-----------------------------------
and if its something like this - https://www.youtube.com/watch?v=7oZu3-PU6KA

 its a whole new aspect
