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

Username:   Password: 
 RegisterRegister   
 Sprite help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RENThead




PostPosted: Mon Jun 18, 2007 10:05 am   Post subject: Sprite help

ok i'm trying to find a way to load sprites into my game but i'm really having a hard time with this sprite command, can anyone help clear it up for me or give me an example? thanks!
Sponsor
Sponsor
Sponsor
sponsor
Albrecd




PostPosted: Mon Jun 18, 2007 10:32 am   Post subject: Re: Sprite help

Check out Paul's Tutorial on the subject.
RENThead




PostPosted: Mon Jun 18, 2007 11:10 am   Post subject: Re: Sprite help

i tried it but turns out sprite commands don't work in 4. anything, is there any other way to do it?
DifinityRJ




PostPosted: Mon Jun 18, 2007 11:13 am   Post subject: Re: Sprite help

Yes with counters. I would explain , but i am short on time. Someone please add to this.
RENThead




PostPosted: Mon Jun 18, 2007 7:25 pm   Post subject: Re: Sprite help

well when you have time could you help me? i'd rele appricate it Smile
RENThead




PostPosted: Tue Jun 19, 2007 8:02 am   Post subject: Re: Sprite help

Ah Ha! so i've figured out a way to do it this is what i've got and it works

Quote:

proc jackrun
var pics : array 0 .. 10 of int
var sprite : int
for i : 1 .. 11
pics (i - 1) := Pic.FileNew ("G:/game/Jack" + intstr (i) + ".bmp")
if Error.Last not= 0 then
put "Error loading image: ", Error.LastMsg
return
end if
end for
sprite := Sprite.New (pics (0))
Sprite.SetPosition (sprite, 0, 100, false)
Sprite.Show (sprite)
loop
Input.KeyDown (chars)
if chars (KEY_RIGHT_ARROW) then
x := x + 1
Sprite.Animate (sprite, pics ((x div 2) mod 11), x, 100, false)
delay (100)
end if
end loop
end jackrun


now if i wanted to make him go a different way would i just put an elsif and just copy what i have and add a few variables, or...?
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: