Attached is my text mode d-pad demo. The chkchr calls are so you can restore what was at the old spot before you move to the new one. Unfortunately what I have doesn't restore colors. Anyway, give it a try. Let me know if you have questions.
It is a user defined function I made. You have to copy the function into your code to make it work. It probably depends on a couple of other helper functions and variables in the code too. Good luck
My SAMPLE project is Key: Q34443GD. In that folder is a file called PLATFORM. Starting on line 362 is a function called LOAD_MAP that will load a map from SmileBasic's Map Editor. I hope that helps.
Lines 74 to 258 is the function that moves the hero around.
It is a lot of code, but what you are trying to do is actually fairly involved. Please give it a read and let me know if you have questions.
My SAMPLE project is Key: Q34443GD. Inside of the project is a file called PLATFORM.
Starting on line 362 is a function called LOAD_MAP that will load map files saved from SmileBasic's map editor. No separate layer files required.
Between lines 291 and 360 are a set of functions used to check if you can bump into a background tile or not (one layer is reserved for non-passable blocks).
It is for loading all four layers instead of just one but maybe the attached map layer loading code will help. What problem are you having with sprites? Use spset to allocate one, spofs to move it around, and spclr to deallocate when you are done with it. You can also set animations with spanim.
Nice Link Chickens32. My samples folder is code Q34443GD. I was thinking of adding a menu to it and republising soon, but the code should be good for a few more days a least. Attached is a small demo of a sprite moving around in response to the d pad.
Here are the changes I did to your draw wheel funtion to get rid of some of the unfilled pixels. Instead of a single line I put in two triangles for a filled quad. I couldn't tell the difference with a lower detail level so I set it to 1 too. Finally I moved the border up top so I could use filled circles for the border. Some more unfilled pixels filled that way. Seems a bit faster with lower DTL
rnd gives you a random number between 0 and the entered value - 1. You only get whole numbers. If you want numbers with a decimal point then you would want rndf (hope I spelled that right) which gives you a random number between 0 and 1 which you could scale to the desired range by multiplication.
Finally, to save your work, hold down the L or R shoulder button and click on the LOAD " button at the top of the screen. Then give your program a name and click ok. To open it again for further editing you would hold a shoulder button and click LOAD ", and select your program. If you want further tutorials, let me know. Maybe I can put up a youtube video or something.