I'm starting to work on my new game. I'm not sure what it's going to be called. But, I've put a lot of thought into it so it should take a while for its release. But the wait will be worth it.
The SWAP command swaps the values of two variables. The CY<2 and CY>0 make sure that the blank space is inside the box after the move. So, if you press right on the D-Pad, it checks to see if the blank space is greater than zero. If the value is true, the it will swap the values of the blank space with the one to the left of it. Then it will move the blank space one to the left with CX=CX-1.
Next is the UNTIL command. In this case, it is used to detect when the puzzle is finished. If the value is true then it will continue to the BGMPLAY command whis is used to play music and simple tunes. The WAIT command waits for two seconts, and finally procedes to reset the game. The @M(0-3) are the different moves that can be performed. I'll explain everything you need in greated detail tomorrow
If the values are equal, then the number will be displayed. And the value will be checked to see if it is in it's original location. After that there are the BUTTON commands. these are used to detect if a button was just pressed on that frame. If the value is true then it will goto the specified label and skip the rest of the BUTTON commands.
Next is the VSYNC which is used to slow the program.