For the first time ever, there is some life in my program! But I have this problem about commands happening at the same time, thus freezing the characters in the wrong position. What would fix this?
I don't know how you coded your game but I guess that you didn't use a game loop pattern.
The pattern look like this:
While the game is running
-Capture/Process the inputs.
-Update the entities on the game(HP, store the next position on the map, etc)
-Render the game
WEND
Now I see the problem, after every input you jump straight to what you want to see, then return to the start.
You need to:
-Store the input for the button in a variable.(VAR B=BUTTON())
-Compare using AND instead of ==(IF B AND #UP).
-Store the changes on a variable(DELTAY=-1)
-Then, change the sprite position(
VAR X,Y
SPOFS 1 OUT X,Y
SPOFS 1,X,Y+deltaY
)
Not understanding this so well. I'm just a beginner. I know what the problem is, I just didn't know how to do it right. And I'm not exactly sure how to put this in, what you're telling me. Sorry. Could you try to explain a little more clearly, if you don't mind?
Another thing you should do is use GOSUB instead of GOTO. GOSUB works the same as GOTO, except you can then use RETURN to make the code return to where the GOSUB was called. For example...
GOSUB @WOW
PRINT "BOB"
END
@WOW
PRINT "HELLO "
RETURN
This will print "HELLO BOB" on-screen. You should use this technique for all the input commands instead of the GOTO @DODGE and then...
You have to study DIM and Array,and you can become shorter program.For example:
SP=8:DIM SC[SP],SS[SP],SX[SP],SY[SP]
FOR I=0 TO SP-1:READ SC[I],SCX[I],SCY[I],SX[I],SY[I]:SPSET I,0:NEXT
DATA (Value),(Value),(Value)...
DATA (Value),(Value),(Value)...
FOR I=0 TO SP-1
SPCHR I,SC[I]
SPOFS I,SSX[I],SSY[I]
SPOFS I,SX[I],SY[I]
NEXT
That's cool! I'd say most of what you'll learn about programming will come from your own experiments, and picking up on better techniques and more efficient ways to program.