#1✎ 188ProKukuAvatar TabooI didn't change my avatar for 180 daysWebsiteFirst YearMy account is over 1 year oldWebsitePokemon Is Awesome!I love Pokemon!Express YourselfI’d like to know how to use CALL SPRITE, along with commands that go with it like SPFUNC and CALLIDX. I got some help from someone a while ago and they used CALL SPRITE, SPFUNC and CALLIDX, but I never really figured out how they work together.
I didn’t see another forum post addressing this exact topic yet, so I decided I should make one, rather than asking on chat like I always do.
#2✎ 884Y_ackHead Adminhttp://smilebasicsource.com/forum?fpid=19365#post_19365'initialize some sprites
'a function that will serve as our sprite callback,
'evaluated each time CALL SPRITE is executed
'log the current ID
'note that it alternates, going through both id 0 and 1 each call
'(you can use additional logging to verify this)
VAR X, Y
'use OUT form of SPOFS to get position
'special var CALLIDX represents sprite ID being evaluated
SPOFS CALLIDX OUT X, Y
'normal SPOFS using CALLIDX
SPOFS CALLIDX, X+1, Y+1+CALLIDX 'just to differentiate sprites
'attach MYFUNC to sprites
SPFUNC 0, "MYFUNC"
SPFUNC 1, "MYFUNC
'evaluate sprite callbacks in a loop
'since we attached MYFUNC which moves the sprite every frame
'the two sprites will move across the screen
#3✎ 188ProKukuAvatar TabooI didn't change my avatar for 180 daysWebsiteFirst YearMy account is over 1 year oldWebsitePokemon Is Awesome!I love Pokemon!Express Yourself