This bug for 2 weeks has been plaguing me everytime I tried to fix it.
Here's the deal:
My original code that detected match-3's and created new objects. It was just buggy to the point that it was unplayable.
So, I decided to completely rewrite the code. I scrapped everything match-3 related and rebuilt the code from scratch. (Thanks to C# and #regions!)
Well, the code is very... hrmm, the best description I can think of is "dynamic". The functions shift the intent of the functions that they call.
From here, I created a couple of helpers to manage everything, but I did make one specific function that creates the new tiles and moves them into place. I had just forgotten one specific thing.
Here's the deal:
I had to create a mouse selection routine for the original selection system. Raycasting a point into the level and then determining the closest object to the front of the screen that's clickable.
Now. This selection code uses a Container I had created called the Object Container. It does what it says it does. It contains all of the objects in the game. But here's the catch. If the object you're trying to click on isn't in the Object Container... it doesn't trigger the click. This was my problem. I had completely forgotten to add the new tiles into the Object Container. So when I clicked, they were essentially invisible. One line added and the code is fixed!
I am thinking that this is a problem with the clicking code. I'll probably update the base object creation code to automatically add new objects to the Object Container and this would remove any future similar issues.
Well that's it. Time to go, maybe I'll start on fixing the camera controls since they're not QUITE what I'm wanting...
Till next time!
No comments:
Post a Comment