Mouse Opacity 1.5: Click-Halos in Off Topic
|
|
So, given that RetroQuest has some "actiony" elements (I wouldn't truly call it an action game, as it relies on hit/miss chance rather than hit detection and tiles instead of pixel movement) I've been trying to figure out ways to make it easier to click on the occasionally small or spindly icons as they're moving around the screen.
mouse_opacity 2 was something I tried at the start, but when things got crowded with characters that protrude out of the tile that just made things worse. Then I tried various schemes of passing clicks to a tile onto the character standing in it or else the most recent character who'd left it within a tick. Worked pretty well... didn't always work in the way I expected, and that's the sort of thing that only escalates when there are numerous people who aren't the developer playing... it also didn't work for situations where the mob's icon straddles multiple tiles but it's only in one. (Giant spiders have legs that poke out into other icons, and characters with large weapons have their weapons sticking out.)
I expect that the occasional difficulty in targeting the right mob is only going to get worse when I add smaller, faster moving enemies like bats and smaller spiders. And I'm trying to add some more interest to fishing by adding a random chance that you'll spot a large or special fish that's actually visibly swimming in the water and you have to click on it within x amount of time. I don't want to make the fish huge, but I do want to make it more a matter of speed than precision.
It was when I was working with inventory management using some of the items with icons that are still sized for 16x16 that I noticed that even if mouse opacity is set to 2, the icon's actual size is used, not the tile it occupies. Seems obvious in retrospect. It's exactly what I would have expected for a large icon, but I never made the connection with small icons.
So that gave me how to do the fish... make it occupy a smaller square icon and give it mouse_opacity 2. Easier fish can have a larger bounding box.
In doing that, I realized a solution for critters where mouse_opacity 2 isn't appropriate. Completely transparent pixels (alpha 0) don't seem to be opaque to mouse clicks, but any level of opacity... even an invisible-for-all-practical-purposes 1... are clickable at mouse_opacity 1. So anything that I want to be easier to click, I can just draw a "bounding box" around, or an aura a few pixels wide. Draw it in a solid color, swap it to a light color with alpha 1.
Boom: clickable aura that is undetectable to the eye but not to the mouse. This could eliminate what has been a frustrating element in an otherwise really slick combat system.
|
When someone clicks a turf, cycle through each atom in the turf's contents. For each atom which collides with the click, return the one with the highest layer.