? CALL SPRITE (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

CALL SPRITE

  • #1 ✎ 168 ProKuku Avatar Taboo I didn't change my avatar for 180 days Website First Year My account is over 1 year old Website Pokemon Is Awesome! I love Pokemon! Express Yourself I’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. Posted
  • #2 ✎ 868 Lumage Head Admin http://smilebasicsource.com/forum?fpid=19365#post_19365 'initialize some sprites SPSET 0,1 SPSET 1,2 'a function that will serve as our sprite callback, 'evaluated each time CALL SPRITE is executed DEF MYFUNC '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) ?CALLIDX 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 END 'attach MYFUNC to sprites SPFUNC 0, "MYFUNC" SPFUNC 1, "MYFUNC WHILE 1 VSYNC 'evaluate sprite callbacks in a loop CALL SPRITE 'since we attached MYFUNC which moves the sprite every frame 'the two sprites will move across the screen WEND Posted Edited by Lumage
  • #3 ✎ 168 ProKuku Avatar Taboo I didn't change my avatar for 180 days Website First Year My account is over 1 year old Website Pokemon Is Awesome! I love Pokemon! Express Yourself
    http://smilebasicsource.com/forum?fpid=19365#post_19365
    I saw that post already, it just wasn’t as in-depth as I was wanting. Thanks anyway for the source code though.
    Posted