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

Username:   Password: 
 RegisterRegister   
 Animation Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
andxdreamxixdo




PostPosted: Sat Jan 08, 2005 5:17 pm   Post subject: Animation Help

I am working on a project for my computer class, and after hours of staring blankly at the screen and asking for help from many people I have come here. I keep getting an error and I'm not too sure what it's about, so if anyone can help me, that would be great.

code:
Draw.Line (10, 1, 25, 50, 25) 
Draw.Line (100, 100, 25, 50, 25) 
Draw.Line (25, 50, 25, 100, 25)
Draw.Line (10, 75, 40, 100, 25)
Draw.FillOval (25, 125, 25, 25, 25)


fr1 := Pic.New (0, 0, 600, 600) 
Draw.Cls

Draw.Line (25, 1, 25, 50, 155) 
Draw.Line (25, 100, 25, 50, 155) 
Draw.Line (25, 50, 25, 100, 155) 
Draw.Line (10, 100, 40, 75, 155) 
Draw.FillOval (25, 125, 25, 25, 155) 

fr2 := Pic.New (0, 0, 600, 600) 
Draw.Cls 

 

% Frame 3
Draw.Line (45, 1, 45, 50, 155)
Draw.Line  (45, 50, 10, 95, 155)
Draw.Line (45, 50, 45, 100, 155) 
Draw.Line (30, 100, 65, 75, 155) 
Draw.FillOval (45, 125, 25, 25, 155)

fr3 := Pic.New (0, 0, 600, 600)
Draw.Cls

%Frame 4
Draw.Line (45, 1, 45, 50, 7)
Draw.Line (45, 1, 45, 50, 7)
Draw.Line (45, 50, 45, 100, 7)
Draw.Line (30, 100, 65, 50, 7)
Draw.FillOval (45, 125, 25, 25, 7)

fr4 := Pic.New (0, 0, 600, 600)
Draw.Cls




loop
    for i : 0 .. 600 by 25
        Pic.Draw (fr1, i, 0, picCopy)
        Time.Delay (100)
        Pic.Draw (fr2, i, 0, picCopy)
        Time.Delay (100)
        Draw.Cls
    end for
   
% Animate the frames to make the stick man move back to where he started

    for decreasing i : 600 .. 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



Based on a program from the turring submissions forum of this site.



can can dancing stick man.t
 Description:

Download
 Filename:  can can dancing stick man.t
 Filesize:  1.73 KB
 Downloaded:  137 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Jan 08, 2005 6:11 pm   Post subject: (No subject)

(I'm assuming that's the entire code, and that there is not View.Set or setsceen anywhere before the code you posted.)
You're getting the error because the picture (taken by Pic.New) was not successfully created, as Turing kindly tells you. Now, the reason it was not successfully created is because you are trying to take nothing and put it into a picture. Apparently, Turing doesn't like having nothing in a picture. The "nothing" I am talking about is not white background, but actually nothing. See, you are taking a picture of (0,0,600, 600). But, the screen only goes from (0,0) to (639, 339) (at least on my computer). So, you are trying to take a picture of stuff (nothing) that is off the screen.
In short, to solve the problem, change:
code:

fr1 := Pic.New (0, 0, 600, 600)

to
code:

fr1 := Pic.New (0, 0, maxx, maxy)
andxdreamxixdo




PostPosted: Sat Jan 08, 2005 6:46 pm   Post subject: (No subject)

hey thanx alot your a life saver.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: