Equippable items

Programmers know how hard it is to accomplish this: finding an item, picking it up and moving it to an inventory, equipping it, removing it from your inventory, resorting the inventory, showing the result on your avatar, unequipping the item, and show that on your avatar and in your inventory too. Meanwhile all the visible and invisible information about the item, whether it’s displayed as a simple icon in a window or in full swing on your avatar, must be remembered and data integrity must be ensured. So many things that can go wrong! The round trip is complete now, which is a proof of concept: if this works with two items and two slots, it can be done with thousands of items and multiple slots.

There’s a lot of code under the hood steering all this. Also the drag and drop feature was completely programmed from scratch to get full control. An interesting bug was the background music fading away as soon as you changed clothes: this is because whenever you change clothes, the avatar is rebuilt, which automatically retriggers the audio dome you’re standing in at that moment (if any). We have now implemented a counter that adds one whenever you change clothes, and subtracts one whenever you enter a dome. If you enter a dome and the counter is zero, only then will the music fade in. A dirty solution, which hopefully shows that lots of unexpected things can go wrong when implementing something that looks so simple.

Post your comment

New demo and main theme
New main theme