mordrax / cotwelm

Castle of the Winds (A Remake in Elm)
http://game.castleofthewinds.com
103 stars 11 forks source link

new viewport algorithm: center character on screen when reaching the edges #8

Closed djuretic closed 7 years ago

djuretic commented 7 years ago

I've changed the viewport algorithm, my aim was to be closer to the original game. Comments are welcome.

I feel that the new updateViewportOffset function can be refactored into several little functions.

Screencast:

out

mordrax commented 7 years ago

This is awesome! :) Love how it is moving like the original game. I'd need to have a closer look at the code though, the function signature of Model -> Model -> ... worries me a bit, i think it should be reduced to Model -> <Some Delta> -> .., but yeah, great work! :)

djuretic commented 7 years ago

@mordrax done! Now the function signature is Vector -> Model -> Vector.

djuretic commented 7 years ago

Thanks for the feedback, I've updated the code.