Im building a plataform of card games, with retro style. My first game was blackjack, but im having a problem with the textures of the game, after the third of fourth playtrough, the textures of the cards goes missing. I dont know if it is a problem with babylonjs or my code.
One thing for sure, is that i`m receiving an error Webgl context was lost, and idk if it is because of this.
I would guess that it has something to do with your code, but in that case we need to see your code somehow it would be helpful.
For now, what I can say, first few times, Deck.png is loaded correctly, but it seems that you request Deck.png image everytime (at least for few 3-4 restarts), and later Deck.png is requested somehow randomly. I cannot figure out the pattern, it’s something like every third restart, then it increases to every sixth and then i kinda goes lower again, like every 4-5 restarts (you can see on image that there are many requests for Deck.png
So first, I believe that you should request/load Deck.png only once (loading texture shouldn’t be attached to restart button. Maybe that’s the reason why texture doesn’t show.
I remade my code, so that i would not create so many meshes of boxes, for each card on the deck. Now i only create te boxes that apear on the screen, and the game can run about 60 matches before come to this problem, that continue to happen. Even if i put all boxes on a container, from assetscontainer and dispose them.