Computer Science Canada Sprite |
Author: | Tallguy [ Mon May 11, 2009 9:32 am ] | ||
Post subject: | Sprite | ||
so i've looked every where on compsci and can't find anything to help me i wanna make a game with Sprites, sortta like this http://compsci.ca/v3/viewtopic.php?t=16534 how do i get the sprites moving for example to walk i use the pictures in order in the walk folder know what i'm getting at? do i use an array like...
i am throughly confused any suggestions? plz |
Author: | DemonWasp [ Mon May 11, 2009 11:31 am ] |
Post subject: | RE:Sprite |
You want to look for the Pic and Sprite modules in the Turing help (though honestly you can do it best with just Pic). Alternately, check out the tutorials here: http://compsci.ca/v3/viewtopic.php?t=8808 , particularly the Graphics section and the Pictures article. |
Author: | DifinityRJ [ Tue May 12, 2009 11:12 am ] | ||
Post subject: | Re: Sprite | ||
I didn't test the code, but from my experience with sprites, you can do this a bit more efficient. Like so:
*notice the array is 'int' not 'string' If the actual program is in the folder with the sprites you don't need "Dooku/Walk/" , Just put "WalkC" +instr(a) + ".bmp" If you need help on animation, I can surely help you, just PM me. |
Author: | tjmoore1993 [ Tue May 12, 2009 4:04 pm ] | ||||
Post subject: | Re: Sprite | ||||
DifinityRJ @ Tue May 12, 2009 11:12 am wrote: I didn't test the code, but from my experience with sprites, you can do this a bit more efficient.
Like so:
*notice the array is 'int' not 'string' If the actual program is in the folder with the sprites you don't need "Dooku/Walk/" , Just put "WalkC" +instr(a) + ".bmp" If you need help on animation, I can surely help you, just PM me. Bad idea. At first it works but then you'll come across errors "Cannot allocate item. Out of id numbers (max 1000)" The best way is to probably define the images outside of a loop.
|
Author: | tjmoore1993 [ Tue May 12, 2009 4:08 pm ] |
Post subject: | RE:Sprite |
Fixed : - No errors - LEFT AND RIGHT key glitch - Updating - Changing Direction etc. ![]() EDIT* Correction, I did not fix the animation. I forgot to but I'm sure someone will reply with an answer! |
Author: | Tallguy [ Tue May 12, 2009 6:22 pm ] | ||
Post subject: | RE:Sprite | ||
sweet thanks both of you you have no idea how much you just helped me out, thanks, i did both of what you two suggested i tried before without succes to get the pic.mirror to work, but you realy helped me out THANK YOU!!
|
Author: | tjmoore1993 [ Tue May 12, 2009 7:13 pm ] | ||||
Post subject: | Re: RE:Sprite | ||||
Tallguy @ Tue May 12, 2009 6:22 pm wrote: sweet thanks both of you you have no idea how much you just helped me out, thanks, i did both of what you two suggested
i tried before without succes to get the pic.mirror to work, but you realy helped me out THANK YOU!!
No problem, notice though how you have used two statements more then what was needed. Instead of using setscreen perhaps using View.Set share the line? Example:
|
Author: | DifinityRJ [ Wed May 13, 2009 10:35 am ] | ||||
Post subject: | Re: Sprite | ||||
tjmoore1993 @ Wed May 13, 2009 10:04 am wrote: DifinityRJ @ Tue May 12, 2009 11:12 am wrote: I didn't test the code, but from my experience with sprites, you can do this a bit more efficient.
Like so:
*notice the array is 'int' not 'string' If the actual program is in the folder with the sprites you don't need "Dooku/Walk/" , Just put "WalkC" +instr(a) + ".bmp" If you need help on animation, I can surely help you, just PM me. Bad idea. At first it works but then you'll come across errors "Cannot allocate item. Out of id numbers (max 1000)" The best way is to probably define the images outside of a loop.
tjmoore, you are doing exactly what I am doing, except you are adding more work for yourself. Your method works if you have two sprites, but when you have more sprites your going to have to keep repeating lines of code, that could be replaced by a for statement. |
Author: | Tallguy [ Fri May 15, 2009 9:17 am ] |
Post subject: | Re: Sprite |
okay, thanks for all the help, i'm still having a few kinks. i'm using the sprites from http://compsci.ca/v3/viewtopic.php?t=16534 because their the best ones i can find the array thingy isn't working, it's not displaying the sprites in order any ideas? |
Author: | Tallguy [ Fri May 15, 2009 11:31 am ] |
Post subject: | RE:Sprite |
i got it working, forgot to add delays lol |
Author: | DanTheMan [ Fri May 15, 2009 11:37 am ] |
Post subject: | RE:Sprite |
This may not have any relevance, but is this the correct file path for your sprites? (Sprintes/Dooku/Walk/WalkC) |
Author: | Tallguy [ Fri May 15, 2009 11:42 am ] |
Post subject: | RE:Sprite |
yeah it is, my problem was it was displaying them at all thesame time because i forgot to add an delay |