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

Username:   Password: 
 RegisterRegister   
 Sprites???
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
STE/-\LTH




PostPosted: Fri Nov 22, 2002 3:11 pm   Post subject: Sprites???

Confused

How on earth do you use sprites??!!!
when i try and use a command like Sprite.New, an error appears saying
"'New' is not in the export list of 'Sprite'"
What is this supposed to mean??? Evil or Very Mad
plz help Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Fri Nov 22, 2002 6:40 pm   Post subject: hummm

this sownds like a bug in turing 3.1.1, you may whont to try resatring turing and trying to run the progame. also if you post the code of your progame it whode help.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
STE/-\LTH




PostPosted: Fri Nov 22, 2002 6:58 pm   Post subject: (No subject)

Confused But I have Turing 4.0.2 or sumthing! Confused
STE/-\LTH




PostPosted: Fri Nov 22, 2002 6:59 pm   Post subject: (No subject)

OH yeah, its version 4.0.4a
STE/-\LTH




PostPosted: Fri Nov 22, 2002 7:04 pm   Post subject: (No subject)

aiight then, this is an example i downloaded in my attempts to find out how to use sprites... among many others, all with the same problem

code:
var facepic : int % This is the actuall picture (bmp)
facepic := Pic.FileNew ("face.bmp") % Turing loads the bmp here
var facesprite : int % This is the actuall sprite
facesprite := Sprite.New (facepic) % Turing takes the bmp and makes it a Sprite

Sprite.SetPosition (facesprite,maxx div 2, maxy div 2, true)
% What this means is we are setting the position of the facesprite in the middle of the screen and having the position
% centered around maxx div 2 maxy div 2. If we were to set it to false it would draw the sprite at the center of the
% screen instead of centering the picture.

Sprite.SetHeight (facesprite,1)
% This is telling turing to put the sprite 1 above the back ground. So we can still draw things on the background right now
% 0 means it will be the back ground
for i : 1..100
        delay (100)
        Sprite.SetPosition (facesprite,i,i,true)
        % Sprite.SetPosition (sprite id, x, y, center)
        % This will move our sprite 100 pixels up and to the right
end for

Sprite.Show (facesprite)

lol, i hope i did this right
Tony




PostPosted: Fri Nov 22, 2002 8:45 pm   Post subject: (No subject)

ya... turing has a reputation of being messed up in many ways, sprites being one of them.

so if you're having trouble, there's an alternative of using Pic.Draw with PicMerge or PicUnderMerge modes.

Pic.Draw(x,y,picID,mode)

if you put PicMerge for the mode of Pic.Draw, it will display the picture with a transparent background.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
STE/-\LTH




PostPosted: Fri Nov 22, 2002 9:32 pm   Post subject: (No subject)

Aiight,
So ive been fiddling around with the pic stuff, waht do piMerge and picUnderMerge do?
Im guseeing that one declares them like this
code:
var player  := Pic.FileNew ("tiles/player.bmp")
Pic.SetTransparentColour (player , black)

you draw them using teh Pic.Draw (x,y,player, picMerge/UnderMerge),
as you explained, but i dont understand how these things work fully.
Tony




PostPosted: Sat Nov 23, 2002 2:08 am   Post subject: (No subject)

The idea of sprites is to have an image with transparent background, so that you can have iregular shaped objects on screen... such as game character for example.

In most normal programming language, you can just load .gif image, but since haltsoft is too damn cheap to buy a licence for using gifs, you can't do that Evil or Very Mad

now you still can draw your game character using Pic.Draw with PicMerge mode. You use it the same way you use PicCopy.

To animate, you edit postion of images in your "render scene" part of code.

Also, white's the color for transparent background... If you happen to have some white that you want to keep, redraw the picture, editing those areas to 2nd closest color on 256 color scale.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
JayLo




PostPosted: Wed Dec 04, 2002 12:32 am   Post subject: (No subject)

could you post an example for newbs like me??
Tony




PostPosted: Wed Dec 04, 2002 12:40 am   Post subject: (No subject)

sure, what kind of examples do you want?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 10 Posts ]
Jump to:   


Style:  
Search: