PetitModem is hard to get working. Make sure to choose the slowest speed, and the two way communication mode (duplex if I remember). Also make sure the settings on the computer and smile basic sides match. Packing and unpacking files is also fairly cryptic. If you have the special cable try plugging mic into headphone and headphone into mic. If not turn things up obnoxiously loud and hope.
You can load an image and put it on the drawing page with something like the attached. If you just want to change the background tileset you could add something like load "grp5:<filename>", false. The background would ideally not just be random stuff too. You would be better of reading that from file or data statements instead.
Attached is a small program that animates a rotating spaceship that you can move around with the circle pad. The "I" option does keyframe animation. The data is loaded up from a data statement at the end of the code. The first number is the number of frames. After that you have two numbers per frame. The first is duration in 1/60ths of a second, the second is the sprite definition number to show.
Thanks. To run the program there are two buttons on the bottom left display [I think], and edit switch from edit to display [I think] then either type run or click the run button in the upper right of the bottom screen and hit enter to run what you typed in in edit mode. Hold down the L button and click the save or load button to save/load what you wrote in edit mode.
The first half looks ok, but after that, I think you want something like:
var name$
input "Give our hero a name"; name$
if name$ =="2" then
print "That's a cute name."
endif
Attached is a small number guessing game. You get a random number between 0 and one less than the number entered in parenthesis with the rnd() function. The repeat/until command will execute a block of code over and over until a condition is true. Otherwise everything else in the code should look familiar. Let me know if you have questions or want more examples.
if you use else it runs only when the original if and any elseif statements were never executed. endif says you are done with the if command. For each condition we print out some text. Note how we can glue bis of text together with +. On numbers that would do addition instead. str$ changes a number into a string. I hope that all makes sense.
Lines 4 and 5 let you ask the user for data and save it into a variable. One we are finished with that we make a decision in the code with IF. Between IF and THEN you write an expression that evaluates to true or false in the case we compare age% to a set number. If the expression is true the next block of code is evaluated otherwise it is skipped. You can add extra checks with elseif.
As you move on you will want to save things in variables. Line one - option strict - turns on requiring variable declarations which is useful. Line 2 - var - declares two variables name$, and age%. In SmileBasic you set the type of variable by the symbol on the end of the variable name. % is for whole numbers, # for numbers with a decimal point, and $ for strings which hold text/words.
When you first start programming, it is customary to begin with a hello world program. Type the attached code in the editor then switch to the run window, type RUN and hit enter to get the program to execute.
The print command prints out the text between the double quotes, in this case Hello World. Try modifying the code to write something different to the screen.
That is just one map, but it has four layers. If you put everything on a single layer, you can skip the other three. For multiple layered maps, you can move the layers at different rates to get a nice parallax effect.
If you go to the smile tool and then the spdef tab, you can scroll through them. The top screen tells you the number of the selected tile. However, it is really just a 16x16 pixel grid numbered left to right top to bottom starting at zero.
You probably want to change 64, 32 to 64, 64 in the code since I was only using the top half of the map. If you do it right you can get something like the attached image. Truthfully however, I might just skip the map editor and use read/data commands to design things since you can't choose any size other than 64x64 in the map editor.
Here is a demo of what I mean. You can skip the grp5 load if you don't have custom bg tiles. While you still want to save in the map editor so you can edit things. The layer files you get from the sc save command. Change the file names as appropriate.
It sounds like you are trying to parse a command line. Perhaps the attached code's split function will help. You pass in a string, a delimiter, and an array to fill. It chops up the string wherever it finds the delimiter putting the vales in the array. [warning, it emptys the array first].
use sc save instead of save in the map editor. This will create a file per layer. For each layer, load that as a dat: file into an array then pass that array to bgload. If you have custom tiles load that as grp5:filename.