![]() Use in conjunction with $01ACF9 and a Table to make it generate a random sprite from a list! Not only can you have a custom sprite generate many different kinds of custom sprites with ONE routine, but you can do some real cool tricks with it too. $08: Y Offsetting of generated sprite (hi byte).Ĭustom sprite customization improves DRASTICALLY with this routine. $07: Y Offsetting of generated sprite (lo byte). $06: X Offsetting of generated sprite (hi byte), when its Facing Direction = right. $05: X Offsetting of generated sprite (lo byte), when its Facing Direction = right. $04: the Custom Sprite number from sprites.TXT to generate. Right before you JSR to this routine, you need to set the Ram addresses $04, $05, $06, $07 and $08 to certain values. JSL $07F7D2 | create the sprite and set flagsĪs you can see, it requires some setting up. Generated sprites do NOT call their INIT routine.īMI RETURNB / return if none left before anything else. should be called from the generated sprite code. $05-$06 should have X offsetting (to the right), When called, $04 should have custom sprite number to generate. This Routine is adapted so that you can have one sprite generate whatever sprite you want based on a Ram address instead of a Defined variable. It's an alternative method I'm gonna try using for all my future custom sprites. I wrote a modified version of the Custom Sprite Generation Subroutine by smkdan. The Master Hand sprite uses this during it's Flick Counterattack, and also when it aims before firing his Energy Gun attack.Įdit: Okay, check this out. If it works though, it should be pretty awesome. This routine hasn't been tested and might not work though, so if using it, caution is advised. Now it vertically stays locked on to Mario. LDA $D8,x | (uses 16-bit "A" momentarily)ĮOR t_EOR,y reverse if needed- makes value a positive valueĮOR t_EOR,y \ value's /- is now opposite of whatever it started as XBA | get sprite relative position to Mario JSR SUB_VERT_POS "Y" now has 00 if sprite above Mario or 01 if below Mario Copy Paste SUB_VERT_POS from the Subroutine Library somewhere in ![]() ![]() When called every frame, sprite will vertically stay locked onto Instead it sets the sprite's Y speed higher or lower depending on how far away it vertically is from Mario, so rather than snapping to his Y position it smoothly slides up or down to match his level.Ĭode But this doesn't mean the sprite's Y position permenantly = Mario's Y position. Each routine is rather small too.Īlso, I coded a subroutine that a couple of those "action routines" will use, which locks the sprite's Y position on Mario. It's actually pretty fun to code this sprite! I coded a routine at the beginning that branches to 1 of like 20 different MAIN routines depending on what a particular Ram address is (that's what needed the "JMP (abs, x)"), and I'm currently just coding each individual routine jumped to by that. Roy taught me a new technique for this sprite: I finally got to use Indirect Indexing, via "JMP (abs, x)"! If you don't know what that means in ASM terms, let me explain it: imagine a JMP command that uses a Table and X Reference to decide where to JMP to, and every value on the Table is a Label name that appears somewhere in the. The fact that it'll be more complex to debug doesn't phase me a bit the Debugger can solve ANY problem that comes up, if TRASM.exe doesn't alert me of them first. I was gonna just test parts of him at a time as I code them, but decided no it's better I just finish it up all at once. Learn some tact, and better grammar while you're at it, before I burst a blood vessel. You're really getting annoying, with the lame posts you make and the PMs you've sent me and my friends asking for custom sprite requests. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |