Aseprite Scripting and Laser GIFs
This update didn’t alter the product, but instead focused on the product’s landing page by adding GIFs and changing the order of the lasers in the demo to match the order in the description. I made the GIFs with an Aseprite script, which I intend on using again to save a massive amount of time spent on other animations (more on that later).
For the GIFs, I thought about doing a wave of lasers turning on and off, starting from the top laser (Blue) and ending at the bottom laser (Inverted White). However, the order of which the GIFs are loaded isn’t always on sync, so I decided to use only idle animations.
Since I did all of the sprites on Photoshop, there were no frames or layers to use when I imported the laser spritesheets to Aseprite. This meant that I would have to copy each segment of each laser and paste it into different frames.
That leaves us with 16 frames for 6 segments for 10 idle laser animations. 16 x 6 x 10 = 960… I would have to copy and paste 960 times! For professional animators that can be a pretty standard workload, but I’m a lazy programmer so I decided to automate it with a script.
The Spritesheet to Aseprite Script interprets a spritesheet and uses it to make an Aseprite file with separate frames, making it easier to export an animation from it. By providing the path to the spritesheet in the script, it iterates through the columns, creating a new frame for each iteration. If it reaches the end of the columns before reaching the number of required frames, it wraps back to the first column, maintaining the animation’s cycle. After all necessary sprites are collected and all frames are made, the result is exported into the Aseprite file, whose path is also provided in the script.
For the specific purpose of making the laser animations, which needs multiple segments of a laser running at the same time, I made the script combine the segments of the laser found in separate rows into a single big laser sprite. The speed of the frames are determined at the start of the script, this case being 24 fps.
If you’re interested in downloading this script for making your animations, please let me know in the comments and I’ll make a generic version that doesn’t just work for the laser spritesheets I was using. I’m thinking this could be useful for character sprite animations, where a “mesh” source file of the character could be used to generate a spritesheet of several frames of that character in different poses in the output file, similar to Aarthificial’s pixel art animation technique for Astortion (check out “Pixel Art Animation - Reinvented - Astortion Devlog” on YouTube, it’s mind blowing).
After the script was done, all I had to do was change the initial path’s name for each laser variation and export the resulting files as GIFs. I’m happy with the way the GIFs turned out, since it’s another way of showing potential clients how the laser looks, apart from the Laser Demo I made.
Thanks for reading, and merry Christmas!
Files
Get Ultimate Laser Pack
Ultimate Laser Pack
Animated laser beams for 2D Pixel Art games
More posts
- First Release41 days ago
Leave a comment
Log in with itch.io to leave a comment.