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

Username:   Password: 
 RegisterRegister   
 I need help with Sprites
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
programming hippo




PostPosted: Sun May 27, 2007 12:01 pm   Post subject: I need help with Sprites

I am doing a grade 11 project using Turing. The question I would like to pose is if Sprites can be used wit Pic.FileNew? In the Turing help file it says it works with Pic.New but when I run my code using Pic.FileNew no error appears. This leads me to think that it can work with Pic.FileNew but the way I'm implementing my code is stopping it from showing. The reason I am trying to use Sprites is so I can change the background image using the Sprite.ChangePic command to change the background image instead of redrawing it. If there is a better way that this can be done please tell me. Thank you for reading and I appreciate any and all help given.
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Sun May 27, 2007 1:23 pm   Post subject: RE:I need help with Sprites

My version of turing doesn't include the sprite module, but the way I do sprites is just picID:=Pic.FileNew(fileName), draw the background, then Pic.Draw(picId,x,y,picMerge). The important part is the picMerge, it merges your picture with the background.
DIIST




PostPosted: Sun May 27, 2007 1:38 pm   Post subject: Re: I need help with Sprites

Just create your own sprite class, its not hard. Smile
CodeMonkey2000




PostPosted: Sun May 27, 2007 1:45 pm   Post subject: RE:I need help with Sprites

I know, but I don't think programming hippo knows about classes...or does he/she?
programming hippo




PostPosted: Mon May 28, 2007 10:12 am   Post subject: Re: I need help with Sprites

When I test the following code it says that the execution of the program is complete but the run window does not appear. I know this means that there is no output. What I do not understand is why there is no output. If someone could explain I would appreciate it.

var pic : int := Pic.FileNew ("background blue.jpg")
var sprite : int := Sprite.New (pic)
Sprite.SetPosition (sprite, 0, 0, false)
Sprite.SetHeight (sprite, 0)
Sprite.Show (sprite)

I am using picMerge now but that does not let me put anything in front of the background without me having to redraw it when I change the background. This is why I would like to use Sprite.ChangePic. I do not know what is meant by create my own Sprite class. Thank you for your replies so far.
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: