Hi,
I read that : “Development is lead by Vlad Shcherban” so if he sees this message, I think there is a bug somewhere that is not in my code. (important : if you try the code, just swipe a square to the right, the other directions are not written yet)
I created a basic match-4 game, and a function like “animSquaresToGoDown()” is called in a gameloop if a boolean is true. The squares go down, then another function creates new squares at the top, etc.
It works fine for at least 50 times, but at one point, the other function that creates new squares is called without being actually called. There is only one way to call this function and it is with a boolean to “true” in the gameloop. I added a “print” whenever I put this boolean to “true”, and it always prints “false”.
So my guess would be that the function is somewhere registered in a list, and for some reason, it gets called when it’s not supposed to.
Here is the github if you want to try : GitHub - Orx5/foret: meilleur code, avec perso et id dans meme tableau
The interesting part starts at 344 : gererChercherCasesADescendre() (in english : “findSquaresToGoDown”)
and it set goFaireDescendre = true (in english : “goDown = true”)
then line 553 :
animPersosVersCasesVides() (in english : “animCharactersToEmptySquares”)
should never be called before line 628 :
function gererGameLoopAnimVersCasesVides()
if ( goVersCasesVides == true ) then
animPersosVersCasesVides()
end
end
and “goVersCasesVides” is “false” when it gets called.
It happens 1 out of at least 50 times.