Hi, first thing, sorry for my English.
This script has worked perfectly for me, but I have a little problem that I don't know why it happens.
Sometimes when I add new items, if my character possessed some items, one of the old items is transformed into one of the new items.
For example: If the player had "Wooden Table", "Small Table" and "Large Table" and I add a "Red Cushion", sometimes the "Big Table" becomes "Red Cushion".
It doesn't always happen, but every time I add new items, some of the old ones are modified.
It is only fixed if I throw the items away and buy them again.
PS: maybe it's because when defining them in the code I add them in lines above the old items.
Thank you for this amazing script!
TILEHEIGHT to TILE_HEIGHT
TILEWIDTH to TILE_WIDTH
DEFAULTSCREENHEIGHT to SCREEN_HEIGHT