Computer Science Canada Sprite help |
Author: | warsame [ Sun Aug 23, 2009 3:50 pm ] |
Post subject: | Sprite help |
I was playing around with sprites. I created one which can run and jump. The problem is that when I jump i cant move in the air. I tried but i cant seem to make it work. Help would be appreciated. I have also attached my work.Need help Plz and Thank you. |
Author: | DemonWasp [ Sun Aug 23, 2009 6:28 pm ] |
Post subject: | RE:Sprite help |
There seems to be something wrong with the forum download mechanism - it shows your .rar as 661.23 KB, but when I download it, it's only 22 KB and won't open as an archive. It's easier if you just post your code in [ syntax = " Turing " ] code goes here [ / syntax ] blocks - without all those extra spaces. |
Author: | Tony [ Sun Aug 23, 2009 6:43 pm ] |
Post subject: | RE:Sprite help |
Have you checked the contents of that 22 KB file? Quote: The selected Attachment does not exist anymore 404 File Not Found: The File kakashi_538.rar does not exist. Posting code inline is fine, as long as it's short. Just post the relevant part(s). |
Author: | warsame [ Mon Aug 24, 2009 9:42 am ] | ||
Post subject: | Re: Sprite help | ||
Sorry for late response(Computer sucks) . Well after going through my work i noticed that the problem is that the program cant distinguish the difference key presses. Example left arrow= run left right arrrow =run right down arrow=crouch up arrow =jump down+right=crouch walk to the right I had also put flags for each movement for troubleshooting. I had found that if i press down+right the sprite would just run to the right. But the crouch walk flag was put up. if it would help here is the code. It is quite long
|
Author: | tjmoore1993 [ Wed Aug 26, 2009 2:28 pm ] |
Post subject: | RE:Sprite help |
Can you reupload what you have? Maybe I can assist you. |
Author: | Tony [ Wed Aug 26, 2009 3:18 pm ] |
Post subject: | RE:Sprite help |
The problem is that you check your input all over the place. keys (KEY_RIGHT_ARROW) is checked for 4 times in your code. The actual problem though, is that in your main loop, all UP/DOWN LEFT/RIGHT are not mutually exclusive (if-end, if-end as oppose to if-elsif-end). As such, DOWN+RIGHT satisfies both crouching and runr, so the character does both in the same frame. |
Author: | warsame [ Wed Aug 26, 2009 4:44 pm ] |
Post subject: | Re: Sprite help |
Heres the upload if it would help. Also i was looking at the Bsprite module and i was thinking maybe i should scrap everything and make a new one with the bsprite. Jus looking for help. |
Author: | tjmoore1993 [ Thu Aug 27, 2009 4:52 pm ] |
Post subject: | Re: Sprite help |
I've found your programming a bit to hard to comprehend. I thought I might give it a shot, although there are some known glitches/bugs with movement. I think you can tune that. |
Author: | warsame [ Fri Aug 28, 2009 4:42 pm ] |
Post subject: | RE:Sprite help |
WOW Thank you so much. Yes now that you labeled and organized my work i can fix the glitches. I hope one day i can return the favor. |
Author: | tjmoore1993 [ Sat Aug 29, 2009 10:04 am ] |
Post subject: | Re: RE:Sprite help |
warsame @ Fri Aug 28, 2009 4:42 pm wrote: WOW Thank you so much. Yes now that you labeled and organized my work i can fix the glitches. I hope one day i can return the favor.
Turing isn't that great of a language since it lacks a lot of potential. Don't worry about it, I made sure that I only spent 15 minutes on it. |
Author: | Kharybdis [ Sun Sep 06, 2009 8:44 am ] |
Post subject: | RE:Sprite help |
When using sprites, you should create a function that does the picture name assigning for you. It's very long to do ex. crouchwalk (1) := Pic.FileNew ("cw0.bmp") each time.. |