Did I say another day another extension? Well I actually mean another day another TWO extensions! I present: riknoll/arcade-improved-sprite-data
This extension is an improved version of microsoft/arcade-sprite-data. You might be asking “What makes it so improved?”
Here’s what:
Adds tilemap locations as a type that can stored/read
Adds array versions of the blocks for every type
Puts all the blocks into their own category in the toolbox instead of cramming them into the Sprites category
Adds the ability to define and call functions on Sprites. Now you can have your own pseudo-methods in blocks!
In addition to Sprites, all types (except functions) can also be stored on tilemap locations and objects (i.e. dictionaries in Python terminology)
Because of the objects feature, this extension also effectively replaces microsoft/arcade-block-objects, which is an extension nobody really used because it was a nightmare. This one is much better! The block to create an empty object/dictionary is at the bottom of the category in the toolbox.
For storing properties on tilemap locations, the properties will persist until you load a new Tilemap. If you load the old tilemap again, all of the properties for each location will be restored.
Note that this extension is not compatible with microsoft/arcade-sprite-data. You can add them both to your project, but the properties stored by them are completely separate (properties written by microsoft/arcade-sprite-data can’t be read by this extension and vice versa).
because you can store the data on the sprite! a lot of times, sprites will have properties that don’t make sense to store in global variables.
for example, if your game infinitely spawns enemies and you want each of them to have their own health values, you can’t create infinite variables on the fly but you can store the health on each one using this extension.
Im so happy i procrastinated working on my game before i found this! I can make my combat system using “methods” and redo the whole item system with block objects!! (paralel arrays were horible compared to this)
Also, is it somehow possible to use “inputs” or return a value from the functions? It would be super usefull to be able to do something like “can sprite see tilemap location x y” and return a boolean. And is it possible to define functions for block object too, not just sprites?