![]() |
New games every week!
SmileBASIC - What's it Like?
Blog
5th August 2025
Ooh, a bonus Blog!!
-=-=- Michael Fernie asks of SmileBASIC How is the language to use? What does it look like? SmileBASIC is a Modern Basic, and if I had to say it was like anything specific, I'd say it's very much in the vein of BlitzBASIC, more along the lines of Blitz2D/3D, than BlitzMax. That's what drew me to it. I've been using Mark's Blitz/Monkey languages since the early 2000s, and when SmileBASIC came along with a similar-enough syntax, I hopped right on board. The base syntax is very very familiar, and in fact I pinched a couple of little elements for JSE! ![]() a="Hello" b=6 Print a Print b But the variable types can't easily mix, so you can't Print a+b. You have to Print a+Str$(b) If x==a then (You do need the "then") do this endif All a fairly familiar syntax. Functions are in the style of COMMON DEF FunctionName(a,b,c) Return a+b*c End But have all kinds of different style rules, like if the function's going to return, you need the brackets, but if the function doesn't return anything, you need to write it without the brackets..!! Draws (lines, rectangles, circles) get drawn by default onto Layer 0 Or you can SetTarget to change these to layer 0,1,2,3 or 4, to draw buffered elements. You can GCopy (I think that's the command) to Graphics Copy a chunk from one layer to another, and such, so that you can build up the layers onto one another. Layer 4 is where the sprite graphics are held, and Layer 3 is where the font graphics are held. If you want to draw to these you're free to do so, and can load+save graphic layers with the GLoad and GSave commands.. or is it LoadG and SaveG..? Both exist, I can't honestly remember which is which right now!!! Sprites are handled with SP... commands, like SPDef to define an area on the spritesheet as a numerical number, and then SPSet SpriteID,DefID to set that sprite to be that Def.. Then you SPOfs SpriteID,x,y, and SPRot SpriteID,angle and SPScale SpriteID,ScaleX,ScaleY (I think, or is it size? I can't remember off the top of my head) and other such commands to move the sprite, and recolour and all the other standard stuff. You can define 8192 definitions, and 4096 sprites, so you do have a huge amount you can play around with. The definitions also don't have to be any predefined size, so if you draw a giant 1024x1024 monster sprite, you can do that! .. But you only have a 2048x2048 "Layer 4" you can draw all the sprites on, so.. careful!! There's commands for playing default sounds, and a nice library of them, but also commands to build up your own sounds, and then the music is mostly done using MML commands, but with added instrumentation in the mix. Again, a library, or bring your own MML. Go Get It!All in all, it's quite a handy language, and is incredibly capable when you start learning the ropes. If you're familiar with the Blitz languages, or indeed my own JSE, then you'll be right at home with SmileBASIC. It's a lovely language. Highly recommended. ![]() SmileBASIC can be picked up in the Switch eShop on either Switch 1 or 2. UK Store link or search for SmileBASIC in the eShop. I'd recommend picking up the version with the extra Server Ticker. Makes for a slightly easier experience! Otherwise you can only download 1 or 2 things a day, and if you want to grab my entire 155 game archive, that's going to take a while!!! Having at least one server ticket gives you unlimited downloads. Each server ticket also gives you 10 upload slots. You can, of course, delete uploaded files to reuse your slots, replace things, or update them. But if you want to upload anything, you'll be wanting some slots. Upload slots/tickets are IAP's beyond the initial 10. ... So you can imagine how much I've spent on the 155 games that are up there. ![]() On your Switch, you can have as many "projects" as you want, and each one can have a myriad of .prg code files and .grp image files. You can plug in a USB keyboard, or if you have a USB Wireless keyboard with a dongle, those seem to mostly work, too. (But not all!) You cannot, (without farting about with hacks and such) easily transfer anything to the Switch, though. You're in "Nintendo Says No" territory for a lot of stuff, so if you do want to code on it, you'll either be using the tools that are in the thing, or downloading SmileBASIC code-based tools that others have made. .. Or make your own tools! Views 416, Upvotes 5
Daily Blog
,
Smilebasic
New games every week!
|