[4.5.X] Make Your Start Screen Sparkle! 🌟

Jonny

Well-known member
Here's a way to add a sparkle effect to your title screen like this...

starthingBHD.gif

1. Create a User Variable starPos (Set initial value to 255).

2. Open your TimerEndScripts.asm scroll to the end and add the following at userEnd1_action:

Code:
userEnd1_action:
    INC starPos
    LDY starPos
    CPY #13
    BCC UpdateStarPos
        LDY #0
        STY starPos
   
UpdateStarPos:
    LDA Xtable,y
    STA Object_x_hi,x
    LDA Ytable,y
    STA Object_y_hi,x
    RTS
(Code improved by CutterCross)

3. At the very end of TimerEndScripts.asm where the tables are definied, add these two...

Code:
Xtable:
    .db 165, 68, 192, 51, 131, 173, 51, 140, 92, 140, 79, 157, 107
Ytable:
    .db 139, 131, 40, 71, 132, 164, 71, 60, 123, 131, 67, 76, 68

This is where you will put your own X and Y values for where you want the sparkle object to be.
Plan out so the sparkle object isn't moved on top of another object.

4. Make a monster object (the sparkle) with its animation and set up like this...

monsterinfo.gif

5. Place the monster on your start screen.

Enjoy!
 

vanderblade

Active member
@Jonny Dumb question, but how do I determine the x and y values? When I try this out, my object seems to go to random places, even when I change the Xtable and Ytable values.
 

vanderblade

Active member
Those values are pixels positions (your screen resolution is 256x240) ;)
Thanks, Dale. That helped. Since each tile is worth 16 pixels, it's easy to figure out positions for those wondering. The other thing people unfamiliar with basic code might want to know is that the #$13 in Jonny's code refers to the number of coordinates, so you'll want to change that depending on the number of coordinates you want to include. I'm using this setup to create a boss that warps to specific points on the screen during battle, which is another great use of it. Thanks again, @Jonny and @dale_coop.
 

karikas

New member
I was looking for something just like this, it's perfect for my current project and I learned a few things about ASM too with this great example. Thank you for sharing!

I'll note that when I tried this and my sparkle "monster" had 8 frames of animation, it didn't work (just stayed in the initial sprite placement position)... anything with 7 or fewer frames worked perfectly.
 
Last edited:
Top Bottom