that line of code was so long i had to take multiple screenshots to get it all. anyway, onto my main rant.
RANDOMIZED UPGRADES SUUUCCCKKK TO CODE, DUDE.
and what do i mean by that, you ask? well, i had to create 3 different rarities (common rare epic) and sort NINE different upgrades into them. five in common, three in rare, one in epic. i had three upgrade slots that i needed to fill, so i had to… INHAAAAALLLEE… make nine different sprites, use reference images for some of the weapons, create separate lines of code for EVERY SINGLE UPGRADE, make names for all of them that would fit in the screen as one single line, make three different random number generators from 1 to the number of upgrades in each rarity, and on top of all that, copy and paste the code THREE TIMES. one for each slot. so that all comes together to make a three-slot upgrade randomizer. the code is held together by popsicle sticks, elmers glue and prayers, but it works. miraculously enough, it works. i… i want to not exist anymore.
Have you heard of arrays? They can store more than one value so you don’t have to make giant if conditions like that, Instead you can just use a array to have a index point to a option.
Hate to be that guy, but this is what arrays are for…
Then again, I have been wanting an excuse to tell @richard that having the ability to create Classes in blocks would be pretty cool! Idk if that’s something an extension could add, but I’m certainly not good enough at the block syntax to make such a thing.
You can get “class-like” functionality by using the Sprite Data extension, which lets you add attributes to sprites. In combination with functions, you essentially can create child classes of the Sprite class.
I specifically use classes to avoid using sprites, just because they are such a hit to fps! I don’t think that my rat extermination game could handle 200+ rats at 400 fps if they were all sprites. It’s kinda disappointing, but finding alternatives to sprites is a lot of fun!
Here is a horrible example that doesn’t explain anything whatsoever:
I’m sure you will be able to figure out arrays just by looking at the code and won’t have any problems at all because I’m so good at not explaining anything!
PS: @ADM_F literally sent you a whole write up like a few messaged above this! The least you could do is read it!!