basicallydan / skifree.js

:ski: The classic PC Game SkiFree, but in JS.
https://basicallydan.github.io/skifree.js
MIT License
511 stars 129 forks source link

Introduce concept of Position on Map #9

Closed basicallydan closed 11 years ago

basicallydan commented 11 years ago

At the moment sprites only exist within the world of the viewport. This is fine but it means doing a lot of movement based around the position of the player. It might be better for ease of expansion for sprites to exist independently of the player and have a position on the mountain, and for the viewport to move whenever the player moves.

I.e.

skier.on('move', function () {
  viewport.centerOn(skier.getXPosition(), skier.getYPosition());
});

This means a few new things are much easier to do:

basicallydan commented 11 years ago

Fully implemented in 8dfe1d5