SargeDev Better Settings - Undefined images from an array

Hi all,

I am trying to save my inventory for a survival game I am working on. I have so much done, and I am so close, but the final step is getting my inventory to save. I have made an array of names, images, and amounts to pull from and I am saving them using SargeDev’s Better Settings. The issue I am having is when I try to load, it says I have a "cannot read properties of undefined, width. When I draw the inventory of images to the screen it is there, but for some reason this code isn’t working. Any help would be very very much appreciated. All the code that applies can be seen below.

Thanks in advance!

Nope…spent hours trying to figure this out and realized it was me not subtracting 1 from the array! It was trying to make an image on something that wasn’t there. Sorry! I posted about an hour to soon. I guess this is everyone’s reminder to subtract one from your arrays!

3 Likes