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

Username:   Password: 
 RegisterRegister   
 Need Help Attaching Pictures and animating them
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cool1143




PostPosted: Sat Dec 05, 2009 4:00 pm   Post subject: Need Help Attaching Pictures and animating them

What is it you are trying to achieve?
DDR (dance dance revolution game), need to have an arrow move upwards


What is the problem you are having?
Have no idea how to make a picture of an arrow move upwards, i already can make an turing drawn arrow move upwards, but not an actual picture

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


var x1, x2, x3 : int  %values for x co-ordinates
var y1, y2, y3 : int  %values for y co-ordinates

%declares all the co-ordinates so it is easier to modify

x1 := 100
x2 := 125
x3 := 125
y1 := 100
y2 := 115
y3 := 85

for i : 1..400
drawline (x1,y1, x2, y2, brightblue) % draws triangle
drawline (x2,y2, x3, y3, brightblue)
drawline (x1,y1, x3, y3, brightblue)
delay (3)
drawline (x1,y1, x2, y2, white) % erases triangle
drawline (x2,y2, x3, y3, white)
drawline (x1,y1, x3, y3, white)
y1 += 1
y2 += 1
y3 += 1
end for



Please specify what version of Turing you are using
Turing 4.1.1



ddrarrow.gif
 Description:
 Filesize:  8.05 KB
 Viewed:  4296 Time(s)

ddrarrow.gif


Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Dec 05, 2009 4:15 pm   Post subject: Re: Need Help Attaching Pictures and animating them

cool1143 @ Sat Dec 05, 2009 4:00 pm wrote:
i already can make an turing drawn arrow move upwards, but not an actual picture

They work the same way. You can apply the same technique to move where the image files are drawn just the same.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
cool1143




PostPosted: Sat Dec 05, 2009 5:00 pm   Post subject: Re: Need Help Attaching Pictures and animating them

what i mean is that how do you replace the turing drawn triangle with the picture attached...
TheGuardian001




PostPosted: Sat Dec 05, 2009 5:05 pm   Post subject: Re: Need Help Attaching Pictures and animating them

Use Pic.FileNew to load the image, and Pic.Draw to display it where you want.
cool1143




PostPosted: Sat Dec 05, 2009 5:14 pm   Post subject: Re: Need Help Attaching Pictures and animating them

ok... but what if the directory changes, because ill have to drop off the file later to another computer
Superskull85




PostPosted: Sat Dec 05, 2009 5:32 pm   Post subject: Re: Need Help Attaching Pictures and animating them

Use a relative path as opposed to an absolute path. For example, Pic.FileNew ("MyPicture.bmp") as opposed to Pic.FileNew (C:/MyPicture.bmp").

Relative paths will add the current directory to the beginning of the path you specified. So if you have a picture called "MyPicture.bmp", and your program exists in the directory "C:/My Programs/Animation/" the overall path will become "C:/My Programs/Animation/MyPicture.bmp". Similarly if you copy your projects folder into a directory called "D:/Drop Off/" than the full path would become "D:/Drop Off/Animation/MyPicture.bmp".
cool1143




PostPosted: Sat Dec 05, 2009 6:03 pm   Post subject: Re: Need Help Attaching Pictures and animating them

um... ok, i did the relative directory, but it saids illegal pic ID

Turing:

var ddrArrow : int
var x1, y1 : int := 100

ddrArrow := Pic.FileNew ("GIF:ddrarrow")
for i : 0 .. maxy
    Pic.Draw (ddrArrow, x1, y1, picUnderMerge)
    delay (10)
    y1 := y1 + 10
end for
Pic.Free (ddrArrow)


anything wrong??? and the pic is in the same directory with the same name : ddrarrow.gif
Superskull85




PostPosted: Sat Dec 05, 2009 6:33 pm   Post subject: RE:Need Help Attaching Pictures and animating them

I like to simply use:

Turing:
ddrArrow := Pic.FileNew ("ddrarrow.gif")

Instead of the alternate way of passing an image. Also depending on your version of Turing GIF images may not be supported (even though the documentation implies that they are).
Sponsor
Sponsor
Sponsor
sponsor
cool1143




PostPosted: Sat Dec 05, 2009 6:35 pm   Post subject: Re: Need Help Attaching Pictures and animating them

i did both, and they still do not work

my version is 4.1.1
B-Man 31




PostPosted: Sat Dec 05, 2009 10:25 pm   Post subject: RE:Need Help Attaching Pictures and animating them

have you tried loading it if it is in a .jpg or .bmp?

try to do that, if you open it up in paint, just save as a .jpg or .bmp and then try it. see if you still get that problem.
TheGuardian001




PostPosted: Sun Dec 06, 2009 1:22 am   Post subject: Re: Need Help Attaching Pictures and animating them

It appears to actually be a problem with the image. opening it in an editor and resaving fixed the problem, downloading as a different format didn't.
cool1143




PostPosted: Sun Dec 06, 2009 2:03 pm   Post subject: Re: Need Help Attaching Pictures and animating them

PROBLEM RESOLVED!!!! the original picture was corrupted... thank you all for helping me! My and my project partner hopefully would have a finished and working DDR game by the end of this week (i hope...)
cool1143




PostPosted: Tue Dec 08, 2009 1:41 pm   Post subject: Re: Need Help Attaching Pictures and animating them

um... bump, delete topic, question answered? (how do you delete your topic)
Insectoid




PostPosted: Tue Dec 08, 2009 1:42 pm   Post subject: RE:Need Help Attaching Pictures and animating them

You don't. You leave it here so other people with the same problem might find it and fix it.
B-Man 31




PostPosted: Wed Dec 09, 2009 9:05 am   Post subject: RE:Need Help Attaching Pictures and animating them

there is a question answered button in the little tool bar at the top right of your first post.
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  [ 15 Posts ]
Jump to:   


Style:  
Search: