I'm still learning this myself, but read the Help documentation for SPCOL (initialize collision information) and SPHITSP (detecting when sprites touch). When you know sprites are touching, have the program behave accordingly.
Just keep in mind that this version of BASIC is different from most, being specialized for the 3DS. Heck, most platforms implement BASIC at least a little differently. But you should find a lot of things in common.
I bought it for portable programming, and I love it.
The language is relatively simple, especially compared with other versions of BASIC, but it's weak on in-app tutorials. You'll have to read example code, skim Smilebasic.com, ask questions, and of course experiment. But it's totally worth it.
I'm glad I moved Petit Computer to my 3DS when I could. This version is even better, of course, but I still have some PTC projects that I use regularly.
That's the basic idea, yeah. I actually made a general "lightbox" engine so I could make lots of games in this style. It's going to take some tinkering before it's ready for general distribution though.
Public Key [W3CY43HJ]
Thought I'd get my feet wet with a little minigame. Inspired by Dot Arcade on Wii U, this is an original game where you dodge the cliffs as you freefall.
Here's a few more:
http://smilebasic.com/en/beginner/intro/download
Keep in mind, most of these are simple projects; they're mostly just to demonstrate to new users how downloading works.
Good question! As far as I can tell, your code is right. I tried it myself and it worked correctly. What does it print as the value of these variables when INPUT fails? If it's a 0, it may be incorrectly detecting that you've pressed enter on your keyboard or the A button.
SAVE "TXT:[filename]",VARNAME$
Be careful, because program files are considered text files in this version; if you name your save file after your program, you'll erase your program!
The fundamentals are in chapters 25-27 of the manual: PRINT, Variables, and Conditional statements. Practice and see what you can do with those, because everything else that you do builds on those ideas.
There's also an online instruction list: http://smilebasic.com/en/reference/ I'd hold off on the sections relating to graphics and reading the controller until you understand the fundamentals.
Hang on, I was wrong!
If you define your function like this:
DEF FUNC A,B
...
END
And call it like this:
FUNC A,B
It should work. Note the lack of parentheses; I think that was where the problem was.
Thank goodness. That's much more useful.
It's been a while since I've done data structures, but I know Smile BASIC has Push, Pop, and Shift functionality in its arrays.
You can see the complete instruction set online at smilebasic.com and the instructions relating to data structures in particular are here: http://smilebasic.com/en/reference/#variable