crkellen / bands

A real-time online multiplayer CTF shooter game
GNU General Public License v3.0
5 stars 4 forks source link

Aiming when on the left or bottom edge of the map. #39

Closed Dorover closed 7 years ago

Dorover commented 7 years ago

When you're getting close to a border (bottom or right*), and you're between the middle of the screen and the border, the character doesn't follow the mouse properly anymore. This would seem to be caused by the mouse being tracked in relation to the middle of the screen, instead of in relation to the player's location on the screen, although I'm not a 100% on that.

*Edited, originally read "left", but was supposed to read "right" the whole time.

crkellen commented 7 years ago

Thanks for the bug report! I'll take a look at this later today!

crkellen commented 7 years ago

This is caused by not checking for the other deadzones. Fixing it now.

crkellen commented 7 years ago

So this actually turned out to be a very complex issue with roots in how the camera works. I spent a good hour or more on this so that I wouldn't have to hardcode the values. However, it seems that for some reason it is absolutely insistent on making the deadzones at WORLD_WIDTH - canvas.width, WORLD_HEIGHT - canvas.height.

A strange issue. I will revisit it sometime later.