The score should be the maximum distance travelled by the rocket. Although the rocket can go backwards on the same screen, the score shouldn't decrease in that respect.
The score can be just:
constant * (ship.body.position.x - ship_starting_position.x)
The score should be the maximum distance travelled by the rocket. Although the rocket can go backwards on the same screen, the score shouldn't decrease in that respect.
The score can be just:
constant * (ship.body.position.x - ship_starting_position.x)