Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Lander, a lunar lander style web game (ehmorris.com)
564 points by ehmorris on March 5, 2023 | hide | past | favorite | 170 comments
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




Good fun. A couple of ideas, zoom in as you approach the landing site, it's hard to see the difference between 4mph and 1mph; and consider having no landing spots, like craters or sharp edges; finally, some slow flying asteroids to avoid every once and a while. Consider planting a little flag from previous landing or tombs on crash sites on restart, to have some continuity. :)


This feels like an achievement:

  Unbelievable, the crater is visible from Earth
  
  Score: 190.2 point crash
  Speed: 1612.3mph
  Angle: 98.6°
  Time: 220 seconds
  Flips: 0
  Max speed: 1612.3mph
  Max height: 4534ft
  Engine used: 15 times
  Boosters used: 129 times
  https://ehmorris.com/lander/


Took it up to 1 million feet, it took another 1.5 million feet to bleed off 4000mph upward acceleration, then turned the pointy end downwards and accelerated.

  Unbelievable, the crater is visible from Earth

  Score: 1117.8 point crash
  Speed: 9876.7mph
  Angle: 177.3°
  Time: 2101 seconds
  Flips: 0
  Max speed: 9876.7mph
  Max height: 2505688ft
  Engine used: 3 times
  Boosters used: 271 times
  https://ehmorris.com/lander/


I used the same strategy. Same results with the bleed off. I was surprised how much I had to keep correcting my angle on the way up and down.

    Unbelievable, the crater is visible from Earth    
    
    Score: 921.4 point crash
    Speed: 8113.1mph
    Angle: 174.8°
    Time: 1638 seconds
    Flips: 0
    Max speed: 8113.1mph
    Max height: 1686337ft
    Engine used: 417 times
    Boosters used: 603 times
    https://ehmorris.com/lander/


This is the fastest I've ever seen!


Fun game! After climbing to 1 million feet, it took over 500,000 more to finally reverse direction with the ship pointed down and the engines firing.

  Unbelievable, the crater is visible from Earth

  Score: 869.4 point crash
  Speed: 7757.3mph
  Angle: 62.2°
  Time: 1319 seconds
  Flips: 0
  Max speed: 7757.3mph
  Max height: 1549465ft
  Engine used: 11 times
  Boosters used: 351 times
  https://ehmorris.com/lander/


Well, my middle finger is numb, but I beat 1000 points. I took a straight path upward, and then switched to a horizontal -90° burn, slowly shifting to a -135° burn as I got closer to the ground.

    Unbelievable, the crater is visible from Earth

    Score: 1606.2 point crash
    Speed: 14427.6mph
    Angle: 18.9°
    Time: 1567 seconds
    Flips: 14
    Max speed: 14427.6mph
    Max height: 1361872ft
    Engine used: 1 times
    Boosters used: 438 times
    https://ehmorris.com/lander/


I managed to get my rocket very very slowly rotating (<0.1° / s), so that I could just hold the acceleration and have it do one arc from launch to crash:

    Unbelievable, the crater is visible from Earth

    Score: 1712.2 point crash
    Speed: 15226.2mph
    Angle: 174.3°
    Time: 5963 seconds
    Flips: 0
    Max speed: 15226.2mph
    Max height: 1993862ft
    Engine used: 21 times
    Boosters used: 14 times
    https://ehmorris.com/lander/


This reminds me of when I made a parody "game" once, where all you had to do was click to get a point.

I had included a message at 10k, for a friend that I had expected to check the js source, but to my surprise a non-programmer friend send me a screenshot of it. He just kept clicking "to see if something would happen".

If only I had thought to turn it into an app with some ads at the time, there's a whole idle game genre these days. In some situations people will go to surprising lengths for a basically meaningless and pointless payoff. I still enjoy driving off the map in Trackmania myself. Takes almost an hour, but it's very zen.


Now that's impressive.

1h40m for it though..., that's an extra 1h15m for just 800mph more. With some tweaking of your initial launch angle (get it somewhere between 40-60° rather than 0° which is what I'm assuming yours was, correct me if I'm wrong), plus maybe a second fine-tuning once you reach apolune, I'd guesstimate you could make 25000mph in ~3000 seconds.


The quickest (in terms of time elapsed) crash I've been able to get is 5 seconds. I think 4 may be just about possible, with the right initial conditions.

    A smooth… wait… you crashed

    Score: 26.1 point crash
    Speed: 94.8mph
    Angle: 140.9°
    Time: 5 seconds
    Flips: 0
    Max speed: 94.8mph
    Max height: 240ft
    Engine used: 1 times
    Boosters used: 4 times
    https://ehmorris.com/lander/
ehmorris, this is addicting for all the wrong reasons.


4 seconds on my 3rd attempt somehow

  A smooth… wait… you crashed

  Score: 29.0 point crash
  Speed: 88.2mph
  Angle: 173.4°
  Time: 4 seconds
  Flips: 0
  Max speed: 88.2mph
  Max height: 218ft
  Engine used: 1 times
  Boosters used: 3 times
  https://ehmorris.com/lander/


Nice. I can get 5 reliably, but haven't been able to get 4 at all.


Apparently the timing isn't tied to the framerate, so after I ran the game on a faster computer I got 2 seconds quite consistently

  A smooth… wait… you crashed

  Score: 28.7 point crash
  Speed: 80.4mph
  Angle: 178.4°
  Time: 2 seconds
  Flips: 0
  Max speed: 80.4mph
  Max height: 185ft
  Engine used: 1 times
  Boosters used: 2 times
  https://ehmorris.com/lander/


Yeah that is a flaw. You could also just make your browser window very short on desktop. I think if it’s shorter than the lander height you may land in 0 seconds?


I made my browser short and then zoomed the window as large as possible

Daily Challenge #5 8.4 point crash

3.2mph | 82.2° | 0 flips So, so close to a landing, but still a crash

https://ehmorris.com/lander/ 0 seconds Max: 3.2mph | 12ft Game size: 191x57


When you can actually land (not crash) in 2 seconds, NASA may have a role for you...

(8s was the best I managed but still a "fender bender").


Wow, I need to make a new crash blurb


How about some blurbs related to the flip count?

    Unbelievable, the crater is visible from Earth

    Score: 421.9 point crash
    Speed: 3737.1mph
    Angle: 57.9°
    Time: 567 seconds
    Flips: 1463
    Max speed: 3737.1mph
    Max height: 47969ft
    Engine used: 3 times
    Boosters used: 140 times
    https://ehmorris.com/lander/


I just did a run with 469 flips (and a crash) and the rain of confetti from the hi-speed flipping was really something.


Exactly! Flipping it makes even more fun than the exact, propper, landing ;)

https://www.owsiak.org/i-just-could-not-help-myself-lander-i...


If you really want to, you should add achievements.


Landed in 8 seconds -->

Terrible landing, you need to land slow and straight

Score: 27.9 point landing Speed: 11.3mph Angle: 5.6° Time: 8 seconds Flips: 0 Max speed: 39.0mph Max height: 173ft Engine used: 2 times Boosters used: 5 times https://ehmorris.com/lander/


I just got:

    Unbelievable, the crater is visible from Earth

    Score: 309.4 point crash
    Speed: 2607.1mph
    Angle: 176.2°
    Time: 293 seconds
    Flips: 0
    Max speed: 2607.1mph
    Max height: 174828ft
    Engine used: 6 times
    Boosters used: 54 times
    https://ehmorris.com/lander/
lol (and now I see others have already beaten this...)


Not the worst landing, but not very good either

Score: 63.6 point landing Speed: 4.9mph Angle: 4.1° Time: 26 seconds Flips: 0 Max speed: 21.5mph Max height: 236ft Engine used: 30 times Boosters used: 8 times https://ehmorris.com/lander/


I now have joined the club too

Unbelievable, the crater is visible from Earth

Score: 314.8 point crash

Speed: 2657.5mph

Angle: 174.1°

Time: 471 seconds

Flips: 0

Max speed: 2657.5mph

Max height: 179734ft

Engine used: 4 times

Boosters used: 83 times

https://ehmorris.com/lander/


i'm now a club member too Unbelievable, the crater is visible from Earth

Score: 324.3 point crash

Speed: 2900.4mph

Angle: 16.7°

Time: 1943 seconds

Flips: 56

Max speed: 2900.4mph

Max height: 751071ft

Engine used: 14 times

Boosters used: 170 times

https://ehmorris.com/lander/


  Perfect landing, incredible, you can’t get better than this

  Score: 99.2 point landing
  Speed: 1.0mph
  Angle: 0.2°
  Time: 52 seconds
  Flips: 0
  Max speed: 31.5mph
  Max height: 389ft
  Engine used: 99 times
  Boosters used: 7 times
  https://ehmorris.com/lander/
I think my initial conditions were advantageous..

Great game!


The amazing thing is all these lunar lander games are harder than actually landing the lunar lander that landed on the moon. That's right it used a computer stabilized system and featured a fully automatic landing program however every lander was actually landed in the semi automatic mode where the pilot controlled the descent but the attitude was still maintained by computer.


And they used an analog computer to integrate and display the landing trajectory in real-time, just like in this game iirc.


Interesting talk about it and the landing process: https://youtube.com/watch?v=B1J2RMorJXM


Lunar module guidance was fully digital. Analog computer was partially used in Saturn V.


Nice one.

The left-right feel swapped to me, but I fail to give a factual reason.

Also reminds me of two 90s era DOS games: Ugh and some other about landing on Moon. Similar to yours, but the lander looked like a small tower/crate (for lack of better description).


I felt the same about wanting left-right to be swapped when I played on mobile, and I crashed every time. However, on desktop, the controls feel just right (with the arrow keys) and I landed every time. Could also be related to the vastly larger screen space on desktop.


Ah. Yes. Should've mentioned I was on mobile.


I think some games in this style rather have you fire the left thruster with the left arrow key and firing the right thruster with the right arrow key, which kind of makes sense in its own right.


I agree about the left-right issue. I just can’t get acclimated to the current controls. Lovely game though, still good fun :)


To counter those occasional asteroids that bizarrely, coincidentally seem to blast through the exact spot where the lander lands — how about adding the ability to take off again once having landed?


For folks for whom this is scratching an itch, highly recommend you check out Reentry: An Orbital Simulator. It is a beautiful indie passion project trying to faithfully recreate all aspects of the 1960s space era, in which you'd go through the actual steps necessary to operate the aircraft, including the lunar lander. It's awesome in it that it tries to be faithful, like NSSP and things of the nature, while also not cutting corners in the "game-like" parts of the experience, like textures, audio design, missions, VR capability, etc. If you enjoyed this for more than a few minutes, you'll enjoy poking around in it!


You'll never improve on Astro Chicken :). Seriously, I loved that game when Space Quest III came out, although it seems others had quite a different experience.

https://www.youtube.com/watch?v=Zgt17LwmT7c


I created a discrete (and less realistic) version of this concept here: https://qewasd.com/ ("Lunar Landing" challenge) - try to get a score as close to 0 as possible!

Some people have managed to use MILP solvers to optimally solve some of the other problems

Code here: https://github.com/void4/qewasd


Still addicted. Two suggestions: 1. Factor in time to landing in the score; faster times score higher. 2. Add an option to make the meteor debris damaging.


Reading more of the discussion, I withdraw the suggestion of incorporating time into the score. It's rendered moot by both the window height and (potentially) the computer clock speed affecting the timing.


Doesn't work for me. I can't get past "2 arrows at the same time". I press them, and see flame from both side thrusters, but the game doesn't register that I've done 2 arrows, and does not let me play. Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0


2 arrows: up and any of the lateral thrusters together ;)


Ah, thank you! I feel like a fool. I was assuming any 2 arrows. Now it works :)


Ah I will update the wording!


Landed on first try, years of playing Kerbal Space Program have come in handy :D


Pretty fun! I like trying to make as many flips as possible:

  Basically a fender bender, but you landed
  Score: 45.4 point landing
  Speed: 3.5mph
  Angle: 9.5°
  Time: 62 seconds
  Flips: 18
  Max speed: 86.8mph
  Max height: 1276ft
  Engine used: 32 times
  Boosters used: 55 times


Same

  Just shy of a good landing
  Score: 78.3 point landing
  Speed: 5.5mph
  Angle: 0.3°
  Time: 577 seconds
  Flips: 206
  Max speed: 302.4mph
  Max height: 12012ft
  Engine used: 69 times
  Boosters used: 89 times


Flipping is really fun. If you do really many you'll get the color particles in straight lines coming down:

  Unbelievable, the crater is visible from Earth
  Score: 143.9 point crash
  Speed: 1259.8mph
  Angle: 35.0°
  Time: 629 seconds
  Flips: 1709
  Max speed: 1259.8mph
  Max height: 44983ft
  Engine used: 1 times
  Boosters used: 58 times


I went up to 20,000+ feet, flipped 1000+ times, but then didn't land it. I couldn't get it to stop flipping before it crashed.


My best is 22 flips. I did them on screen.


How is this a crash, because of the angle?

    So, so close to a landing, but still a crash

    Score: 1.6 point crash
    Speed: 2.5mph
    Angle: 12.2°
    Time: 20 seconds
    Flips: 0
    Max speed: 34.5mph
    Max height: 221ft
    Engine used: 20 times
    Boosters used: 14 times
    https://ehmorris.com/lander/

This is my best attempt for now:

    A good landing, keep trying

    Score: 84.1 point landing
    Speed: 4.5mph
    Angle: 0.0°
    Time: 23 seconds
    Flips: 0
    Max speed: 32.5mph
    Max height: 221ft
    Engine used: 26 times
    Boosters used: 13 times
    https://ehmorris.com/lander/


New personal best!

    Very nice landing, amazing

    Score: 92.2 point landing Speed: 0.5mph Angle: 2.2° Time: 25 seconds Flips: 0 Max speed: 25.8mph Max height: 221ft Engine used: 27 times Boosters used: 25 times


Beaten, a bit, but beaten!

Very nice landing, amazing

Score: 93.9 point landing Speed: 2.2mph Angle: 0.1° Time: 17 seconds Flips: 0 Max speed: 24.4mph Max height: 236ft Engine used: 9 times Boosters used: 15 times


Near-perfect landing, super smooth

Score: 95.4 point landing Speed: 2.0mph Angle: 0.0° Time: 21 seconds Flips: 0 Max speed: 32.0mph Max height: 221ft Engine used: 34 times Boosters used: 16 times https://ehmorris.com/lander/


Heck of a lot better than me! After probably 50 successful landings, all my bests hover around 75.


Yep the angle can't exceed 12


> Angle: 12.2°

What is this, Apollo 15?


Tried to get a good landing with as few control actions as possible. For a simple new scoring system, subtract your number of control actions from your landing score:

  Very nice landing, amazing

  Score: 90.5 point landing
  Speed: 2.9mph
  Angle: 0.2°
  Time: 18 seconds
  Flips: 0
  Max speed: 53.7mph
  Max height: 425ft
  Engine used: 1 times
  Boosters used: 3 times
So, a score of 86.5 in the new system.


I was trying the same and this is super impressive… only 1 main engine fire??? I think this is actually part of the constraints of the real world landing problem.


Yeah, first thing I did was to try to get a feel for when I needed to hit the main engine. Executing a landing with 1 or 2 fires I can do with some regularity. Getting the boosters to 1 or 2 is very hard due to initial conditions, but 3 to 5 is also somewhat doable. All of it coming together for a 90 point landing involved some luck for sure.


I like this kind of game, and this is perfect for a short diversion! This is the best I can muster for now:

    Very nice landing, amazing

    Score: 90.1 point landing
    Speed: 2.8mph
    Angle: 0.4°
    Time: 9 seconds
    Flips: 0
    Max speed: 38.7mph
    Max height: 240ft
    Engine used: 10 times
    Boosters used: 10 times
    https://ehmorris.com/lander/


Tons of fun aiming for the different types of high scores. Here are mine:

131 point crash - https://i.ibb.co/YdJ1c8B/131.png 426 max speed landing - https://i.ibb.co/5k5Csjt/Max-Speed426.png


Had a great time seeing how fast I could make it go!

Impressive speed, impressive angle - you crashed with style

Score: 89.2 point crash Speed: 761.4mph Angle: 41.4° Time: 82 seconds Flips: 0 Max speed: 761.4mph Max height: 344ft Engine used: 97 times Boosters used: 45 times https://ehmorris.com/lander/


Very nice, did you hear the baby at the 400mph mark?


I did wonder what that sound was!


That’s my baby


This is adorable.

Great game! I got a 95 point landing after a good few goes then I saw all the fun people were having with the crashes so I joined in. Great job!


lol I sort of thought that was my baby on the monitor


Near-perfect landing, super smooth

Score: 97.5 point landing Speed: 1.4mph Angle: 0.2° Time: 17 seconds Flips: 0 Max speed: 53.3mph Max height: 377ft Engine used: 15 times Boosters used: 12 times https://ehmorris.com/lander/


Love this! Very simple and creative.

  A solid “C” landing

  Score: 71.9 point landing
  Speed: 4.7mph
  Angle: 2.5°
  Time: 276 seconds
  Flips: 27
  Max speed: 114.4mph
  Max height: 1323ft
  Engine used: 58 times
  Boosters used: 63 times
  https://ehmorris.com/lander/


Suggestion of improvement: landing should only be successful if lateral velocity is inside a limit.


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.


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?).


I think this means you “landed” at 0mph. No idea how this would have happened in the background though…


If I understand correctly, I think they mean that the bug is that they achieved a perfect landing by leaving the tab. I think.


  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/


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).


Unbelievable, the crater is visible from Earth

Score: 198.9 point crash Speed: 1,600.2mph Angle: 179.0° Time: 336 seconds Flips: 2 Max speed: 1,600.2mph Max height: 55,433ft Engine used: 7 times Boosters used: 97 times https://ehmorris.com/lander/


Just landed safely, so think I am sending my resume to NASA for the upcoming Moon mission.

https://imgur.com/a/Qq5lqOm


NASA here, your resume got thrown out for not having speed in the green area. Better luck next time.


We want you to take Trump to the moon. Show him some craters in order to find suitable spots for new cities.


Nice job on the game! Fully usable on my iPhone and only took me like 7 tries to actually land. Bookmarked to study the code and learn how you achieved such a nice end result. Thanks for posting.


Unbelievable, the crater is visible from Earth

Score: 465.6 point crash

Speed: 4010.5mph

Angle: 178.0°

Time: 986 seconds

Flips: 509

Max speed: 4010.5mph

Max height: 409430ft

Engine used: 4 times

Boosters used: 126 times

https://ehmorris.com/lander/

It's 1 AM, I need to go to sleep...


Couple of great UX things I’ve found

- the game doesn’t let you play without knowing how to use the controls, and it shows them in real time - whenever you tap, the tap area lights up.

Small Details that make a difference!


Mostly thanks to my friends for play testing it!


Apparently, it's all about feathering the throttle. Very nice!

Near-perfect landing, super smooth

Score: 96.5 point landing Speed: 1.1mph Angle: 0.7° Time: 45 seconds Flips: 0 Max speed: 43.7mph Max height: 256ft Engine used: 73 times Boosters used: 37 times https://ehmorris.com/lander/

---

I see it took you about seven months from "Initial Commit" to its current state. How did you stay on track all that time?


Yes but you can also compete on using as little throttle/booster as possible! IMO the perfect landing is one where you engage the engine at the exact right moment to touch down at <1mph, and you engage a booster only once in order to be upright. Engine and booster use aren't part of the score though.

The older commits were part of a previous idea that I abandoned, then a few weeks ago I deleted almost everything and gave it another try.

Thanks for playing!


> IMO the perfect landing is one where you engage the engine at the exact right moment to touch down at <1mph, and you engage a booster only once in order to be upright.

Would be interesting to see, if optimal control would do just that or use many short bursts.


Yeah, but how many times can you flip the rocket?


Very addictive.

One thing that would be interesting would be a mode where you have limited fuel.

Also, the ability to set different buttons would be good. Towards the end of the landing I want to use one hand for left-right, and the other for the booster rocket, and this is awkward.


I found the font saying the speed and angle were much too small to read, and hard to read against the background anyway, so it was unplayable. No one else seems to have had that problem! macOS 12.5, firefox, 24 inch 1920x1080 display - pretty normal sized. Maybe it works on a phone. I tried zooming in but then I couldn't see the ground, and the font didn't get bigger.


Thanks for the feedback, I ought to just make the font responsive on larger screens. I will get to it!


Nice Game.

  Perfect landing, incredible, you can’t get better than this

  Score: 99.3 point landing
  Speed: 0.2mph
  Angle: 1.0°
  Time: 22 seconds
  Flips: 0
  Max speed: 33.6mph
  Max height: 227ft
  Engine used: 12 times
  Boosters used: 11 times
  https://ehmorris.com/lander/


Great fun!

Terrible landing, you need to land slow and straight

Score: 18.6 point landing Speed: 10.0mph Angle: 8.9° Time: 23 seconds Flips: 0 Max speed: 22.5mph Max height: 248ft Engine used: 25 times Boosters used: 16 times https://ehmorris.com/lander/


Great game. It took me a while to figure out how to start the game. I'd put a "Press space bar to start" somewhere.


I think you meant to do that

Score: 75.8 point crash Speed: 509.3mph Angle: 172.9° Time: 101 seconds Flips: 0 Max speed: 509.3mph Max height: 6618ft Engine used: 8 times Boosters used: 42 times https://ehmorris.com/lander/


It took a lot of tries, but I just barely made it eventually! Btw I'm on my Pixel 7 and it works better than I'd like expected on a phone. Seems like it'd be easier with a keyboard though?

A near-crash, way too fast

Score: 35.0 point landing

Speed: 9.7mph

Angle: 5.6°

Time: 8 seconds

Flips: 0

Max speed: 35.9mph

Max height: 197ft

Engine used: 2 times

Boosters used: 6 times

https://ehmorris.com/lander/


Basically a fender bender, but you landed

Score: 53.6 point landing Speed: 9.8mph Angle: 1.4° Time: 566 seconds Flips: 182 Max speed: 635.2mph Max height: 62510ft Engine used: 109 times Boosters used: 145 times https://ehmorris.com/lander/


Unbelievable, the crater is visible from Earth

    Score: 345.1 point crash
    Speed: 2928.9mph
    Angle: 175.6°
    Time: 696 seconds
    Flips: 28
    Max speed: 2928.9mph
    Max height: 299886ft
    Engine used: 37 times
    Boosters used: 194 times
    https://ehmorris.com/lander/


A near-crash, way too fast

Score: 34.7 point landing Speed: 5.2mph Angle: 10.1° Time: 28 seconds Flips: 1 Max speed: 25.5mph Max height: 138ft Engine used: 16 times Boosters used: 19 times https://ehmorris.com/lander/


Fun game! It would add more to the game imo if there was a fuel efficiency target as well as angle and speed.


Agreed. I tried to get a lot of flips prior to a successful landing, then I realized you can just accelerate upwards to an absurd height and do oodles of flips offscreen before stabilizing to land.

If there were a fuel limit, or if there were some scoring category that showed whether your rocket stayed under a reasonable height, that would make scoring more comparable for everyone.


As ever, this is the kind of problem I find more fun in programming a computer to solve than in solving myself, by hand. But this is a fun implementation! Good controls, too - it only took me two tries to land, which is better than I ever managed with an Apple II and a keyboard as a kid.


Making an autopilot would be fun!


Sweet game!

  Near-perfect landing, super smooth

  Score: 95.5 point landing
  Speed: 1.9mph
  Angle: 0.1°
  Time: 57 seconds
  Flips: 0
  Max speed: 31.6mph
  Max height: 147ft
  Engine used: 82 times
  Boosters used: 33 times
  https://ehmorris.com/lander/


Awesome game! Really addictive :-)

  Perfect landing, incredible, you can’t get better than this

  Score: 101.1 point landing
  Speed: 0.7mph
  Angle: 0.1°
  Time: 26 seconds 
  Flips: 0
  Max speed: 32.4mph
  Max height: 194ft
  Engine used: 53 times
  Boosters used: 30 times


Give this one a go, you know you want to...

https://theintelligentbook.com/thinkingaboutprogramming/#/de...

(programmable lander)


Awesome, the highest crash landing speed I was able to achieve was 97.7 MPH after about 20-30 attempts.


I went off screen, turned around and crashed at 394.6 MPH.


This, and going sideways really really fast is the way. The highest I've seen is 1500mph.


I crashed at 2499.1 mph by going sideways for a long long time. How accurate is your physics? If I hit orbital velocity, will I just orbit the moon? What if I hit escape velocity?


That is amazing. Not accurate at all really, unless the moon was an infinite plane I guess. If you hit escape velocity you'll never land!


This game is gorgeous! It would be nice if the left and right thrust controls could be swapped.


On an iPad, it’s very hard to hit the left/center/right targets accurately. I got some successful landings, but there was a lot of, “No I said center, not left… no, center, not right… ah crap!” If there were keyboard controls, that would help, I think.


There are! You can use the arrow keys. It should work even when there’s touch support. I’ve also thought about moving the boosters all to one side.


I think for mobile interfaces it might be easier to have the engine as the top half of the screen and the boosters as the bottom L/R quarters. That way you could use one thumb each for roll inputs and an index finger for thrust, without having to be very precise about aiming your taps.


Oh, great! Thank you! I must have missed that in the instructions.


I seem to be running into a bug where the velocity gets mis-matched somehow -- the velocity will be listed as above -12 m/s even though the rocket is actually going up, which obviously makes it impossible to land.


Wanted to play, but after the tutorial a first touch makes the ship disappear. When I reload the page, I can see the ship again, and the landing curve, then again if I touch the screen everything disappear except for the stars.


Ah! If you've got a console error I'd appreciate it


Think I figured it out


I'd love to see an indicator showing how quickly you are rotating. That would make the final touchdown a lot easier to get straight, IMO.

Also, could the trajectory stay visible at all times? That would help plan burns better.


If you clone the repo and remove this condition you can try the trajectory at all times: https://github.com/ehmorris/lunar-lander/blob/master/lander/...

IMO it looked like a big noodle, and the "needle" at the bottom bounces around distractingly. Plus, without the help all the time, it's a little harder!


Crashed only once, but for a good one had to practice a dozen times at least.

A good landing, keep trying

Score: 82.2 point landing

Speed: 4.3mph

Angle: 0.7°

Time: 17 seconds

Flips: 0

Max speed: 34.7mph

Max height: 210ft

Engine used: 7 times

Boosters used: 7 times

https://ehmorris.com/lander/


Here's a lunar landing copy I made 15+ years ago, Java *applet*: https://github.com/celwell/space-landing


Great game! For me, controlling the rocket was not that handy, somehow I always wanted to press the opposite button. Will be a option to swap the left and right buttons? That would be great! :)


love it!

    A good landing, keep trying
    
    Score: 83.5 point landing
    Speed: 3.8mph
    Angle: 0.8°
    Time: 44 seconds
    Flips: 0
    Max speed: 32.1mph
    Max height: 257ft
    Engine used: 25 times
    Boosters used: 19 times
    https://ehmorris.com/lander/


I enjoyed the easter eggs!


I played this game on OSX, Windows and Linux using Chrome.

The game is a lot easier and a lot more enjoyable to play on OSX. I reckon it has something to do with the input handling.


Love it. Want more. I would love to see different scenarios and, challenges. Obstacles? different gravity/planets?


I'm going to give you some feedback like your game did me: pretty bad lunar lander game, but it could be worse! Just kidding, I played it a bunch of times pretty fun.


It would be nice if the "how to play" screen gave keyboard equivalents. I was about to give up trying to play until I saw someone's comment about arrow keys.


This is tricky on laptops with touchscreens and keyboards, and iPads with keyboards. Seems there’s no good way to ask “is there a keyboard attached” or “what is the primary input method.” So I have to pick one set of instructions to show based on a guess, even though both inputs are acceptable.


For me (Firefox, Linux) it did give keyboard instructions on the how to play screen.


I feel like the lunar landing aspect is incidental, and this is fundamentally a "impossible-to-please parent for whom nothing is ever good enough" simulator :-)


Nice work!

I think speed should be in ft/s to match height in ft. IIRC on Apollo they used ft/s for descent speeds. (an option for metric would be nice also)


Love it! It's like a cross between Flappy Bird and Asteroids. Nice tutorial at the beginning, too.

Just managed to get a 98.5, which I think was mostly luck.


Crashing sideways is fun, the exploded parts continue to wrap around the screen if you "land" sideways fast enough :D.


Terrible landing, you need to land slow and straight

Time: 8 seconds

Flips: 0 Max speed: 39.0mph Max height: 173ft Engine used: 2 times Boosters used: 5 times


Left and right are backwards on a phone. I'm sure I'd adapt after a few more games, but it's annoying.


Had a lot of fun


Enjoyed playing! Controls are smooth. Would you mind sharing tech used to design the game and exported to html?


No tech, I wrote it all in plain JavaScript, HTML, and CSS. Check out the repo!


Loved the soundtrack, too! Very fitting.


The lander disappears as soon as I touch the controls and never crashes. Iceraven 1.14.0/Android 11


Had a ton of fun with this :) thanks!


Playing the lunar lander game on a Commodore PET is one of my earliest computer memories.


Way more fun if you try to see high you can get your crash score. 26.3 personal best


It seems that higher refresh rate screens make this game significantly harder..


Great game, why can't it go on all directions ? lef, right, down AND UP ?


Reminded me of a game I used to play on Miniclip called UFO Joe!


Fun! I'd like to get a bonus for rotations in both directions.


I had a 1 point bonus for flips in the score but ended up removing it because it felt too overpowered. But! Having a good score AND flips is impressive in itself.


Neat, and fun!

But why does it consume 100% CPU when sitting at the results screen?


Fun. Weird that controls are reversed (left/right).


very good one! Though it wasn't completely clear to me how rating was calculated.


Awesoem job! Thanks for sharing!!


Love it, great work!


Extremly addictive p


i love the confetti/fireworks! great game


well spent 10min, this is a good game!


671 flips, lol


Good fun!


VERY FUN


great game thx


This is like KSP but without the fun.


I wouldn't say without the fun... It makes for a good reinforcement of my landing skillz.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: