Honestly, all you're missing is a few variable labels. I've worked a bit with HTML and the resources I've used for the few project I've done have always had me define every variable in my Index.html so that when the project runs it has a designated place to reference, tho I could be misremembering, so take that with a grain of salt. But it sucks that it wasn't a smooth transition from Scratch to HTML, this game reminded me a lot of stardew but without all of the aspects of stardew that I really dislike (energy, daylight cycle, enemies). I will definitely be returning to this to see how far I can get before my cat decides it's time to stop gaming lol.