Question:
How do you move the position of a sprite in smileBASIC?


Answer:

After defining your sprite using the command SPSET, you can use the command SPOFS to move it to a different position on the screen! Let's say your sprite definition number is 0 for the sprite you want to move. Your code would look like this:

SPOFS 0,60,100

SPOFS allows you to change the X coordinate and Y coordinate of a sprite on the screen. So in the above example, the 60 is the new X coordinate and 100 is the new Y coordinate of the sprite.

Run this code and see what happens. Your sprite should now have a new position on the screen! Congratulations! Try to make the sprite go in other parts of the screen! Explore and see what you can do!

Page updated: October 17th, 2015 @ 11:23 PM Eastern Time
Game Making Tutorials
Find tutorials about your favorite game creation software! Use the navigation below!

Game Maker: Studio
Help, References, and Tutorials
RPG Maker Fes
Help, References, and Tutorials
smileBASIC
Help, References, and Tutorials

Need Help?
Search answers to game development questions or ask a question yourself
Get exclusive updates from ExecuteCode.com!
Join the Email List
Download Books
Search Downloadable Books from ExecuteCode.com
Copyright 2010-2018 ExecuteCode.com.
All Rights Reserved.