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

Username:   Password: 
 RegisterRegister   
 cant make a sprite move
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Weapon X




PostPosted: Sat Feb 26, 2005 1:12 pm   Post subject: cant make a sprite move

i m making a game for a project at school and i cant get the sprites to move. here is wht i my code for the sprite is:
var x, y : int := 0
var pic1 : int := Pic.FileNew ("slime1.jpg")
var sprite : int := Sprite.New (pic1)
var centered : boolean := false
var chars : array char of boolean

Sprite.Show (sprite)

Sprite.SetHeight (sprite, 1)

loop
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
y += 100
end if
if chars (KEY_DOWN_ARROW) then
y -= 100
end if
if chars (KEY_LEFT_ARROW) then
x -= 100
end if
if chars (KEY_RIGHT_ARROW) then
x += 100
end if
Sprite.SetPosition (sprite, 100, 100, centered)


end loop
. the program runs but i cant c the pic. somebody plz help. thanx
code:
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Feb 27, 2005 12:22 am   Post subject: (No subject)

Sprites have stoped working in v4.x, although Dan has a solution.
Flikerator




PostPosted: Sun Feb 27, 2005 11:31 am   Post subject: (No subject)

How is a sprite different from a just a picture?
cycro1234




PostPosted: Sun Feb 27, 2005 12:21 pm   Post subject: (No subject)

With sprites, animation is easier. They don't erase the background when they move. You can also set a depth to them, so they can be part of the background or actual moving figures.
Flikerator




PostPosted: Sun Feb 27, 2005 12:32 pm   Post subject: (No subject)

cycro1234 wrote:
With sprites, animation is easier. They don't erase the background when they move. You can also set a depth to them, so they can be part of the background or actual moving figures.


Alrite thanks, mabey I shall attempt them Razz
Bacchus




PostPosted: Sun Feb 27, 2005 1:02 pm   Post subject: (No subject)

yes but as Tony said, they got rid of sprites in the newer versions of Turing. there is a substitue though... DanSprite (Tony posted a link above) there are a few other files as well, but DanSprite is to be used with offscreenonly while osme other are not. However, DanSprite does have a few bugs (as i found out when i tried to use it). I was pretty sure that he was to busy to update it more so i decided to make my own, and when i finish most of the little details i will be submitting it into the tutorials section with a description on how to use. hmm.. which reminds me maybe i should do more Shocked
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  [ 6 Posts ]
Jump to:   


Style:  
Search: