Lurker News
I’ve been working on this game for the past few weeks. It’s written in plain JavaScript, mostly with canvas, with no dependencies.

The code is here: https://github.com/ehmorris/lunar-lander

Comments (170) 102 threads

Earlier comments
marcodiego1 reply#
Suggestion of improvement: landing should only be successful if lateral velocity is inside a limit.
ehmorris#
Lateral velocity should be taken into account since I'm taking the vector of the x/y velocity. It's just that it needs to be under 12mph, so you can be going pretty fast laterally.
nfriend1 reply#
Think I found a bug! Left the tab (on Firefox mobile on Android) and then revisited it, and now it says: "Perfect landing, incredible, you can't get better than this" with a score of 102.3 (I'm assuming 100 is supposed to be the max score?).
ehmorris1 reply#
I think this means you “landed” at 0mph. No idea how this would have happened in the background though…
DougMerritt#
If I understand correctly, I think they mean that the bug is that they achieved a perfect landing by leaving the tab. I think.
madamelic#

  I don’t think we’re getting back to Earth

  Score: 34.4 point crash
  Speed: 187.5mph
  Angle: 122.8°
  Time: 88 seconds
  Flips: 7
  Max speed: 187.5mph
  Max height: 2336ft
  Engine used: 11 times
  Boosters used: 49 times
  https://ehmorris.com/lander/
Amazing.

  A fast crash, but it could be faster

  Score: 82.9 point crash
  Speed: 689.8mph
  Angle: 56.2°
  Time: 79 seconds
  Flips: 0
  Max speed: 689.8mph
  Max height: 725ft
  Engine used: 3 times
  Boosters used: 46 times
  https://ehmorris.com/lander/
DonsDiscountGas#
Neat!

Couple thoughts:
* I first played this on my phone and the controls are basically backwards, touching right side of screen activates left booster. May be a subjective preference but when I went to a desktop and used the arrow keys (right key -> right booster) that was way more intuitive.
* Does it consider sideways velocity in judgment? Like 5MPH up and down vs a little bit sideways.
* For the love of Smoot please let me change to metric. Angles in radians would be fun too.
Dunno how much complexity you want to add, but limited fuel would be a nice challenge to add. Or landing spot which is moving (up and down or sideways).

Load more comments