You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on a match-3 style puzzle game, coming up with a better algorithm to check all of the spots on the board for matches. I've been pulling my hair out with certain aspects of Actionscript (and also Flixel) but I think I found an easy way to check which squares on my board are currently empty (and should begin the process of queuing up pieces to be generated, and moving the rest of the pieces.)
That said, here's my current process for this:
Scan rows and columns for matching sprites
Discover match, remove matching pieces from sprite group, destroy sprites
Scan rows and columns for missing sprites (using onScreen())
Queue up pieces off-screen to fill those areas and tween the rest of the pieces
Very vague, I understand, but the fact is, when I use onScreen() on a sprite that I have just used destroy() on, the entire game just stops. To test it, I tried onScreen() on a sprite that was clearly present and it would spit back "true" in the logs.
Would love an idea of what is going on here. Thanks!
The text was updated successfully, but these errors were encountered:
It seems you are calling kill() instead of destroy(). If that is the case, the sprite will be marked as non-existent and dead (exists = false and alive = false), however its position won't change, that's why onScreen() continues to return true.
If you are calling destroy(), then you should see an exception.
Hi!
I'm currently working on a match-3 style puzzle game, coming up with a better algorithm to check all of the spots on the board for matches. I've been pulling my hair out with certain aspects of Actionscript (and also Flixel) but I think I found an easy way to check which squares on my board are currently empty (and should begin the process of queuing up pieces to be generated, and moving the rest of the pieces.)
That said, here's my current process for this:
onScreen()
)Very vague, I understand, but the fact is, when I use
onScreen()
on a sprite that I have just useddestroy()
on, the entire game just stops. To test it, I triedonScreen()
on a sprite that was clearly present and it would spit back "true" in the logs.Would love an idea of what is going on here. Thanks!
The text was updated successfully, but these errors were encountered: