Move can mean 2 things and I assume you want to learn both. Let's start with the easier one: position change. Simply add X=X+1 for the right button and X=X-1 for the left, then add +X to your SPOFS to reflect this change. So if you press right, character moves to the right by 1 pixel per frame, same to the left. I recommend VSYNC over WAIT because of less problems.
[to be cont'd...]
The 2nd meaning of move is "animate". Our sprite skated right and left, but we'd rather have him walk. SPANIM is your friend. Try Line 4 yourself. Ignore the meaning of 0,"I" but the 6 means to switch to the next sprite in 6/60 sec like a flipbook, and the final 0 means to repeat back and forth infinitely. Now incorporate this to your buttons. Use WHILE...WEND since it's cleaner than GOTOs.
[tbc.]
Like my green text says, our sample above worked funny because SPANIM kept running whenever the left or right button is pressed, creating the illusion that it didn't animate. To solve this we need to fix the button timing in the brackets. Put 2 in for "no repeats”; we only want SPANIM to run once. Then put 3 to end animation when button is released by having SPANIM display a still image (final 1).
And there you have it! Our sprite stands still when no buttons are pressed, and walks to the direction of the left and right buttons. I urge you to actually type in the codes in each of the pictures to see what works and what doesn't. I'm still learning this myself as well so my code may not be efficient, but at least it did the job.
I did all the hard work, so I've got homework for ya: Make him walk up and down too, so 4 directions. You need the Y-axis, add Y, 680 and 681 for down animation, and 688 and 689 for up animation. It's optional, but I wanna see you accept da challenge :V
Oh man, I had this problem trying to figure this out. Thank you so much.
Also, you can use #RIGHT and #LEFT in place of numbers if you forget the number. Same with #A, #B, and so on for other buttons.
Before I help, can you please show your "tried but doesn't work" screenshot? I expect to see 4 lines each for BUTTON(), BUTTON(2), BUTTON(3), with "...AND 1..." "...AND 2..." lines already added. And of course with the Y equations implemented like Soan said. It's not hard Shadow, I know you can do it!
Awesome job! You're practically 98% done! Hint: fix line 26. Add two characters.
After you fix that, try moving up and down. That should also be an easy fix to you :)
Ummm... no. Ignore the 0, but 206 and 100 represent coordinates - maybe you learned that in your math class. You attached +X to 206 so that whenever left or right is pressed, the X coordinate changes from 206 to the same amount. What about the Y coordinate that is 100? What should you do to it?
Awesome! Congrats!
The reason why you needed to put -Y instead of +Y was because you accidentally flipped your equations in Lines 12 and 13 backwards. So another way is to put 100+Y but fix the signs in Lines 12 and 13.
Finally, your starting point seems to be (199,100) from Line 5. Might wanna match Line 26 there.