Saturday, September 28, 2013

Things that don't make for good screenshots


I spent some time tinkering with the game camera, and got two pieces pretty much working: dragging and pinch/zoom.

The dragging is accomplished by taking long clicks (longer than half a second) and applying the offset from the mouse(touch) down event to the current mouse(touch) position. That's pretty good, but then I have some special case code to get rid of that offset through interpolation, and it's pretty similar to the camera movement code I have in the other branch, which focuses on a hex. Similar, but completely separate. Code redundancy is nice, if I expect one path of the code to be eaten by gamma rays, not so good if I want to maintain it.

The pinch/zoom code is relatively simple: when I detect two simultaneous touches, I capture the distance between them. As the touches update, I compare the new distance to the old distance, and scale appropriately. There's a bunch more fiddliness, and it turns out that I end up snapping the camera position back to where the character is standing, which is probably not the best solution, but it's a solution.

Maybe tomorrow, I'll put in the main menu screen. Cause I can't have a credits screen if I don't have a menu screen.

Maybe I'll update the character movement so he hops instead of blinks.

No comments:

Post a Comment