
-----------------------------------
MysticVegeta
Mon Nov 01, 2004 4:26 pm

HELP! ANIMATED WALKIN STICK!
-----------------------------------
Hi I am currently doing my TIK project in the high school. And my animation requires a walking stick figure. Can someone kindly tell me the code of walking stick animation (right to left) 
Help will be appreciated. Thanks

-----------------------------------
Tony
Mon Nov 01, 2004 5:09 pm


-----------------------------------
well you draw your stickman using lines... then you draw the next frame a little bit to the left, and continue doing so to make it look like an animation.

if you're smart enough, you can figure out the pattern and actually put those few frames inside a forloop, so you dont have to type out the same thing over and over again..

kind of like motion tweening in Flash

-----------------------------------
MysticVegeta
Tue Nov 02, 2004 1:14 pm


-----------------------------------
Thanks very much, but can someone show me a working example.. like can someone make a small one for me so that i will get an idea. 
Thanks

-----------------------------------
Tony
Tue Nov 02, 2004 1:49 pm


-----------------------------------
sure, [url=http://www.compsci.ca/v2/viewtopic.php?t=5745]here's one

-----------------------------------
MysticVegeta
Wed Nov 03, 2004 7:40 am


-----------------------------------
um... thanks but in turing not in flash. If i use flash, my teacher will kill me!

-----------------------------------
Delos
Wed Nov 03, 2004 12:15 pm


-----------------------------------
Yes it's in Flash, but it's the same idea.

Basically you'll be using lots of drawoval()s and drawline()s.


drawoval (100, 100, 20, 20, 7) 
drawline (100, 80, 100, 20, 7) 


And so on and so forth. You might want to move the lines seperatly, or create a number of frames first, take a picture of them, and then replay those over and over.

-----------------------------------
MysticVegeta
Sat Nov 06, 2004 5:32 pm


-----------------------------------
hey thanks... i made one, it is not that good but i think it will work  :wink: 
for x : 0 .. 500 by 25
    %Head
    drawfilloval (489 - x, 295, 10, 10, 7)
    drawfilloval (514 - x, 295, 10, 10, 0)
    %open legs
    drawline (500 - x, 285, 479 - x, 265, 7)
    drawline (500 - x, 285, 520 - x, 270, 7)
    delay (50)
    drawline (479 - x, 275, 479 - x, 255, 7)
    drawline (504 - x, 275, 504 - x, 255, 0)
    drawfillbox (478 - x, 265, 521 - x, 285, white)
    %open hands
    drawline (500 - x, 245, 479 - x, 225, 7)
    drawline (500 - x, 245, 520 - x, 230, 7)
    delay (50)
    drawfillbox (478 - x, 225, 521 - x, 245, white)
    %closed legs
    drawline (475 - x, 285, 474 - x, 265, 7)
    drawline (475 - x, 285, 477 - x, 265, 7)
    delay (50)
    drawline (479 - x, 275, 479 - x, 255, 7)
    drawline (504 - x, 275, 504 - x, 255, 0)
    drawfillbox (453 - x, 265, 496 - x, 285, white)
    %closed hands
    drawline (475 - x, 245, 474 - x, 225, 7)
    drawline (475 - x, 245, 477 - x, 225, 7)
    delay (50)
    drawline (479 - x, 275, 479 - x, 255, 7)
    drawline (504 - x, 275, 504 - x, 255, 0)
    drawfillbox (453 - x, 225, 496 - x, 245, white)
end for
[/list]

-----------------------------------
Neo
Sat Nov 06, 2004 11:14 pm


-----------------------------------
:D LOL, nice job, but  I think you should attach his head to his body  :lol:

-----------------------------------
MysticVegeta
Sun Nov 07, 2004 7:24 am


-----------------------------------
ok thanks i will try that

-----------------------------------
Leftover
Sun Nov 14, 2004 11:41 pm


-----------------------------------
You might want to move the lines seperatly, or create a number of frames first, take a picture of them, and then replay those over and over.

I liked that idea more for mine.

% Title: Animated Stick Man
% Author: Chris Waddilove
% Purpose: BONUS:  Create a walking stickman going back and forth across the screen.  The smoother the animation, the better the bonus mark

setscreen ("graphics:800;155,nobuttonbar")

var fr1, fr2 : int

% Frame 1
Draw.Line (10, 1, 25, 50, 255)
Draw.Line (40, 1, 25, 50, 255)
Draw.Line (25, 50, 25, 100, 255)
Draw.Line (10, 75, 40, 100, 255)
Draw.FillOval (25, 125, 25, 25, 255)

fr1 := Pic.New (0, 0, 125, 150)
Draw.Cls

% Frame 2
Draw.Line (25, 1, 25, 50, 255)
Draw.Line (25, 1, 25, 50, 255)
Draw.Line (25, 50, 25, 100, 255)
Draw.Line (10, 100, 40, 75, 255)
Draw.FillOval (25, 125, 25, 25, 255)

fr2 := Pic.New (0, 0, 125, 150)
Draw.Cls

loop
    for i : 0 .. 750 by 25
        Pic.Draw (fr1, i, 0, picCopy)
        Time.Delay (100)
        Pic.Draw (fr2, i, 0, picCopy)
        Time.Delay (100)
        Draw.Cls
    end for

    for decreasing i : 750 .. 0 by 25
        Pic.Draw (fr1, i, 0, picCopy)
        Time.Delay (100)
        Pic.Draw (fr2, i, 0, picCopy)
        Time.Delay (100)
        Draw.Cls
    end for

end loop


-----------------------------------
Gothic_mind
Mon Jan 03, 2005 11:36 pm

StickMan
-----------------------------------
Ive done the stick man.. since im not at school to gett the code.. i will put it up when im at school next look for a Stickman with a shopping cart.. it took about 4000 lines of code thou'

-----------------------------------
Fiend-Master
Mon Jan 03, 2005 11:42 pm


-----------------------------------
lol stickmen in turing are so much fun to watch move across the screen. good job ppl!

-----------------------------------
Jonny Tight Lips
Tue Jan 04, 2005 1:42 pm


-----------------------------------
If you wanted to make life easy you could just draw all the frames in paint and save them and just use the pic draw commands. Dunno if the teacher would like that but it would make it eayer to do. Insted of having to draw all the lines over and over it would just be one command in a loop. Just a thought.
