Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HELP! ANIMATED WALKIN STICK!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MysticVegeta




PostPosted: Mon Nov 01, 2004 4:26 pm   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Nov 01, 2004 5:09 pm   Post subject: (No subject)

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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
MysticVegeta




PostPosted: Tue Nov 02, 2004 1:14 pm   Post subject: (No subject)

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




PostPosted: Tue Nov 02, 2004 1:49 pm   Post subject: (No subject)

sure, here's one
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
MysticVegeta




PostPosted: Wed Nov 03, 2004 7:40 am   Post subject: (No subject)

um... thanks but in turing not in flash. If i use flash, my teacher will kill me!
Delos




PostPosted: Wed Nov 03, 2004 12:15 pm   Post subject: (No subject)

Yes it's in Flash, but it's the same idea.

Basically you'll be using lots of drawoval()s and drawline()s.

code:

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




PostPosted: Sat Nov 06, 2004 5:32 pm   Post subject: (No subject)

hey thanks... i made one, it is not that good but i think it will work Wink
code:
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




PostPosted: Sat Nov 06, 2004 11:14 pm   Post subject: (No subject)

Very Happy LOL, nice job, but I think you should attach his head to his body Laughing
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Sun Nov 07, 2004 7:24 am   Post subject: (No subject)

ok thanks i will try that
Leftover




PostPosted: Sun Nov 14, 2004 11:41 pm   Post subject: (No subject)

Delos wrote:
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.

code:
% 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




PostPosted: Mon Jan 03, 2005 11:36 pm   Post subject: 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




PostPosted: Mon Jan 03, 2005 11:42 pm   Post subject: (No subject)

lol stickmen in turing are so much fun to watch move across the screen. good job ppl!
Jonny Tight Lips




PostPosted: Tue Jan 04, 2005 1:42 pm   Post subject: (No subject)

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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: