New answers tagged

0

I think the best way would be to make a rectangle for the position and hitbox of each of your chess pieces. After that make a rectangle for the mouse pointer, and use the Rectangle.Intersects method to check if your mouse hitbox intersects with one of the pieces hitboxes, and of course do your logic there.


1

You want to make it so that 'bottom' resolves into the next tile when there is a small increase in _pos.Y, the same goes for 'right' and _pos.X. This will also fix the edge case when you're exactly aligned within a tile ie. 'top' and 'bottom' will be within the same tile in that case. So to calculate the left, right, top and bottom, do something like the ...


Top 50 recent answers are included