Computer Science Canada Sprite Walking |
Author: | Mystify [ Thu Dec 01, 2005 9:34 pm ] |
Post subject: | Sprite Walking |
Anyone have an example of a simple little program that draws a sprite say like mega man or sumthing walking in the direction of the arrow you push and stopping at the spot when you let go?? |
Author: | iker [ Thu Dec 01, 2005 9:59 pm ] | ||
Post subject: | |||
I have the program, but I'm in the process of making a game, so I will just give you a small tutorial
Now, this code is for a 4 way movement, you can change it to 8 easily by having two if chars (KEY... statements, one with up and down, the other with left and right. If you can't figure this out, ask again, and I'll expand a bit, but it is pretty basic. Anyways, happy coding ![]() |
Author: | iker [ Thu Dec 01, 2005 10:04 pm ] |
Post subject: | |
oops, just remembered, right after I posted. Since it is important, right after you draw the background, before the Input.KeyDown, make sure to change movement to false, and if a key is pressed, make it true ![]() |
Author: | Mystify [ Thu Dec 01, 2005 10:13 pm ] | ||
Post subject: | |||
Uhh i changed it around but it doesnt work at all :S
|
Author: | iker [ Sat Dec 03, 2005 7:55 pm ] |
Post subject: | |
yah, sorry, the code that i wrote wasn't an actual code, its an example for you to finish off, because its not complete... I'll post it in a bit |