Can not read properties of undefined (reading 'iface')

I was just busy experimenting with an extension for my school project, when I encountered an error that said ‘Cannot read properties of undefined (reading ‘iface’)’ when I overlap the sprite ‘Rosaline’. Not really sure what it means, but I would like to get it fixed.
Extension is called ‘Card Kit’ by @sylvancircle

Here is the link: https://arcade.makecode.com/S51126-13355-65440-59010

1 Like

Welcome to the forum, @goose!

Something strange is going on here:

Sorry it took me this long to get back to you.

This one threw me for a loop for a bit (and I’ll need to fix the extension so at least this fails out gracefully) but since the code is replicating the memory example, I found the bit that was programmed incorrectly.

Card Ranks (Ace thru King) are numbers (1-13), whereas Card Suits (clubs, diamonds, etc.) are text, so you’ll need to compare the text “clubs” and “diamonds” to the “Card Suits” text attribute. Take a second look at the memory example again, and compare it carefully to the second and third “if then” block, and you’ll see what I mean.

The rest of the game looks beautiful. Good luck and all the best to you!

3 Likes

I’ve figured😅
But the error is fixed now, thanks!

No worries, I’ve fixed the error, thanks to you!
But is there anyway to delete the play grid after completing the game? When I finish playing, it teleports me back to the map, but it still appears on the map. I’ve tried destroying it, but it still doesn’t really work. I’d be really grateful if you help solve the problem.
Thank you!

So… the destroy block for card containers were not behaving as expected, and I’ve released a fix for the extension. If you try to add the same extension (https://github.com/alexszeto/card-kit/) now, you should get a prompt that ask you to remove and replace the card-kit extension, and after the update you can simply destroy “card deck”, “play grid”, and “discard pile” to clean up all the card game related sprites.

FYI, there are going to be times when there’s no proper solution to a problem like this (thankfully this is not the case). In those times you might have to employ some creative thinking. For example, you can always move the position of the card containers outside of the playable area (like x=-10000 y=-10000) and pretend that it’s no longer active - out of sight, out of mind.

1 Like

Thank you so much for this! I will keep your tip in mind, but for now, I’m beyond grateful for this.

1 Like