MirceaDumitrescu / javascript-webgame

0 stars 0 forks source link

Refactor movement system #2

Open MirceaDumitrescu opened 2 years ago

MirceaDumitrescu commented 2 years ago

Currently the movement system is tied to image directions. We are using images for each direction movement. That means, if we want to attach other images to the user(player), we need images for each direction.

Acceptance Criteria: We must be able to rotate an image from Javascript based on the movement direction. For example, adding a backpack or an effect on the player must follow its direction accordingly without the need of 4 copies of that image.

Also, we need to load player sprites the same way. Example: player

This is not the best example since this asset does not provide the image of the player from behind, but, we should be able to use these images for both turning left and right.

Example of output:

example

The dust trail follows the player regardless the direction even though, there is only 1 image for the dust trail.