Replying to:Minxrod
Management numbers are from 0 to 511, not 0 to 999!
Otherwise, it seems to be a pretty good tutorial :)
Maybe add SPANIM, SPDEF?
Thanks! I fixed the error. I'm going to wait a bit and maybe make a part 2 out of all the questions.
Root / Submissions / [.]
ACLS SPSET 0,17Wow, your very first sprite! Now let's break down the code. ACLS is used to clear EVERYTHING (Sprites, text, background tiles, etc.) and it is optional, but I reccomend that you put it at the start of all your programs to clear everything left by other programs. SPSET Is the command that "summons" the sprite the zero is the management number, that number is used to control that sprite and it is decided here it can be anywhere from 0 all the way to 511! You should remember the management number of your player, because it is used to control that sprite in all the other sprite commands. Now, the 17 is the sprite displayed. To find all the sprites and their corresponding sprite number open the Smile tool and go to the SPDEF tab.
ACLS SPSET 0,17 WHILE 1 STICK OUT SX, SY X=X+SX Y=Y-SY SPOFS 0,X,Y VSYNC 1 WENDUse the circle pad to move the fish, wow you're on your way to understanding sprites! Now I'm going to try to break down the code and simplify it. WHILE 1 AND WEND are very similar to @LOOP and GOTO @LOOP, but I'm not going to explain it in this tutorial because this tutorial is about sprites you diploid. Okay, now to the juicy bits. STICK OUT just gets data from the circle pad's horizontal (left and right) and vertical (up and down) positions. Now, I'll explain the rest a bit faster to save time, the vertical position of the sprite is represented by Y and the horizontal X. The circle pad's are SY and SX, so when you move the Circle pad right, SX becomes greater and it adds to X and moves the sprite right with SPOFS. SPOFS is used for instantly moving a sprite to the x and y positions specified. 0 is the management number stated earlier in the tutorial, change it to another number to move other sprites. You HAVE to have previously "summoned" the sprite using SPSET before using any other command or else you'll get an error. X and Y are the X and Y coordinates that the sprite moves to. VSYNC 1 just creates some delay so everything doesn't happen instantly and your fish doesn't go flying offscreen.
ACLS SPSET 0,17Moving sprite:
ACLS SPSET 0,17 WHILE 1 STICK OUT SX, SY X=X+SX Y=Y-SY SPOFS 0,X,Y VSYNC 1 WENDThank you for reading this tutorial, if you want to know more about sprites leave a suggestion in the comments and I'll try to reply!
this tutorial is about sprites you diploidwhy call people "having two complete sets of chromosomes"
this tutorial is about sprites you diploidwhy call people "having two complete sets of chromosomes"
this tutorial is about sprites you diploidwhy call people "having two complete sets of chromosomes"
this tutorial is about sprites you diploidwhy call people "having two complete sets of chromosomes"
this tutorial is about sprites you diploidwhy call people "having two complete sets of chromosomes"