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

Username:   Password: 
 RegisterRegister   
 Using gif sprites/animations and Drawing Polygons
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MichaelM




PostPosted: Mon Jun 04, 2007 3:43 pm   Post subject: Using gif sprites/animations and Drawing Polygons

Two Questions:

Question 1 - I'm wondering if theres a simple way, or even a way at all, to use gif files as animations. The run window shows up blank when I try and use one, even if it isn't animated. However, I am running a pretty old version of Turing (3.1 or something), so maybe thats it. But it seems like it might work cuz no error messages comes up... Or could it be the mode I'm using...

Question 2 - This is for a risk game I'm making, and for part of it i'm outlining every territory using drawline over and over. But then I'll have to fill each territory with a coulor, for now i'm just drawing boxes inside the lines. I'm sure theres gotta be an easier way. It seems like drawing a polygons would make the outline easier, and the filling easier, but I cant figure out the parameters.

Any help? Thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Mon Jun 04, 2007 4:00 pm   Post subject: RE:Using gif sprites/animations and Drawing Polygons

1 - I wouldn't be surprised if there wasn't. I don't know the details of the new version of Turing (or even how common it is for people to have it) but I don't think they had support for animated gif's, just regular "hey look, transparency!" ones.

2 - Drawing polygons requires an array of all the x and y coordinates, but I can't remember exactly how to use it. You could fill it with colour using the drawfill (or Draw.Fill) procedures. But you'd probably get better performance if you had each country as an image (or as a bunch of images, each in a different colour).

I hope that helps at least a little, I'll keep watching this topic to see how it's going.

Lastly, what the hell is your avatar from? I remember that image, I just can't remember where. This along with my post-dentist-appointment-pain is killing me.
DIIST




PostPosted: Mon Jun 04, 2007 4:03 pm   Post subject: Re: Using gif sprites/animations and Drawing Polygons

You need turing 4.05 for support on GIf formats. Other wise you could always try reading the file your self and creating a sprite from that.

As for the drawpolygon procedure the parameters are (x,y:array 1..* of int, #of points ,color:int)
If you took grade ten, im sure your teacher might have mentioned something called related arrays. This is basically one. x,y are two arrays that are related. The specific elements of the array x & y are the "x" and "y" coordinates of a point. A series of 3 or more non colinear points make up a polygon. Here is an example on how you would use it.

Turing:

var x:array 1..4 of int:=init (5,50,45,20)
var y:array 1..4 of int:=init (5,10,45,30)

drawpolygon (x,y,4,7) %Four Point in my polygon

Hope this was helpful Wink
Clayton




PostPosted: Mon Jun 04, 2007 4:13 pm   Post subject: RE:Using gif sprites/animations and Drawing Polygons

Mazer wrote:

Lastly, what the hell is your avatar from? I remember that image, I just can't remember where. This along with my post-dentist-appointment-pain is killing me.


Golden Sun. Wink
MichaelM




PostPosted: Mon Jun 04, 2007 4:46 pm   Post subject: Re: Using gif sprites/animations and Drawing Polygons

Thanks, this is going to save a lot of time! I'll post the final game in a while (its due in about 2 weeks)

Yep, my avatar is Golden Sun Very Happy
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  [ 5 Posts ]
Jump to:   


Style:  
Search: