Hey there! It’s me again yall!
I have another question involving my game, and this time it’s with my inventory object picker.
Someone previously helped me a ton with making an easy object picker for my game, but I’ve hit a snag.
Right now the object picker works wonders, and made my inventory system so much easier to manage, but I’d like to create the option that, once it’s out of tiles in one particular direction or another to pick from, that instead it will switch to either my ‘Arrow’ button, or my ‘Inventory’ button, as lit up in the example image.
Here is the code I’ve been using. It’s been a life saver so far, I just want to make it be more complex. That way I can have the user switch tabs in the pause menu, or get around to different sections of the menu entirely.
Thanks a ton in advance yall!
One way might be to use object groups so that your code works with multiple types of objects.
In the object group window, create a group and put both your square tile, arrow button, and inventory button all in the group.
Now in your code, instead of referencing “Pick the Tile nearest…” use Pick the your group name nearest…"
I am worried though if the arrow will still be too far away and it selector will snap back to the same square instead of making the jump across to the arrow.
If that happens: create a new type of tile object, make it invisible, add it to the object group, then place it next to that existing red tile. When a is pressed, the selector will first move over to the invisible tile. Now, if your events, you can add another event below after the first “a” press event to check if the selector is on top of the invisible tile. If it is, you can use an action to move the selector to the arrow instead.