How does SPSET work in smileBASIC?


The smileBASIC command SPSET creates a sprite. A sprite in your game can do many things: move on its own, move when a player presses a button, collide with other things, be animated, and more.

Here is an example of the command:

SPSET 0,0002

The above code draws a cherry on the screen, if you are using the default sprite sheet.

The first number next to the command (in the example above, it's 0) is a number that you set to identify the sprite. Once a sprite is set a number, you can use that same number to do other things to the sprite using different commands. You can have up to 512 sprites set, using numbers 0 to 511.

The second number next to the command (in the example above, it's 0002) is the image that will display for this sprite. There are over 1000 built in sprites you can use in smileBASIC, so you can choose numbers from 0000 and up! (So 0002 in the default sprite sheet is a cherry) You can also make custom sprites in smileBASIC, too. Explore and see what you can do!

Page updated: October 17th, 2015 @ 11:41 PM Eastern Time

Copyright 2010-2023
All Rights Reserved.
Our other websites: