Hey everyone, I’m back from my hiatus and I’m planning to get serious now! In the following weeks/months you can expect:
- A list datatype extension (Python-like)
- A map/dictionary datatype extension (similar to BlockObjects)
- A ‘BetterSettings’ extension, adding new datatypes to save using the settings namespace
- Making my version of @PixelDoodle’s CyberShift
- Helping with @AbstractDesigner’s Speedun
- More tutorials such as this one I made a while back
- UI Element extension
-
A jam of my own?
And much more!
I’ll also try to participate in more jams, like @Unique’s UAT2
But anyways, that aside - it’s time to talk about the extension:
But what is cluttering anyway?
I’d define cluttering in general as adding unecessary components to your code that make your workspace harder to use and reduce efficiency, but also make it harder to understand the code (especially for collaborators).
This is mostly prominent with block code, but it’s not uncommon for JS code too. A form of cluttering I often see is redundant variables taking up the namespace that are only used once for temporary sprites.
How does this extension help, and how does it work?
To try and combat this problem, I thought of a simple sprite management stack. (Well, it’s not really a stack, but it sounds better so we’ll roll with that terminology)
Using the extension, you can load a sprite object to this stack with a label, and the sprite can later be accessed and used as any other sprite stored in a variable (img. 1).
When you’re done using the sprite, you can offload it, which will remove it from the stack and destroy it (img. 2).
WARNING (1/2): Destroying a sprite won’t remove it from the stack alone
(2/2): Accesing non-existing items will throw a sprite stack extension
Available blocks
There are 4 available blocks at the moment:
Load sprite
Loads the given sprite into the stack under the defined name
load <sprite> with name <name>
Get sprite from stack
Returns sprite object by name from the stack. If a sprite with that name is not found, an error is thrown.
get sprite with name <name>
Offload sprite
Destroys and removes sprite from the stack by name. If a sprite with that name is not found, an error is thrown.
offload sprite with name <name>
Check if sprite with a name exists
Returns true if a sprite with the given name exists in the stack.
stack contains sprite with name <name>
To conclude this, I’d like to say that I’ve been sitting on this idea for quite a while, so I’m glad to release it now since it only took me like 15 minutes to make this extension.
If you have any questions or problems, feel free to ask here or submit an issue!
(Repo/extension link)