Where programs live
The engine that actually runs your JS is different depending on where you are:
- In a browser, the engine is Chrome / Edge / Firefox, which is exactly how the finished game in
app1/runs. - On your computer, the engine is Node.js, the fastest way to see a program run.
A program is never special to the machine. It's just text the engine reads top to bottom and carries out, one instruction at a time.
This is how the real game starts.app1/js/main.js: the game's entry point, begins by grabbing the canvas and starting the loop, in the same "first instruction" spirit asconsole.log.
The edit → run feedback loop
The heart of learning to program is the feedback loop. You change something small, you run it, you watch what happened, and you learn one thing about how the language behaves. Repeat.
Edit text → Save → Run → Observe output → Learn → Edit again
This loop is honest: the computer does exactly what you tell it, never more. That honesty is what makes programming a great thing to learn, every mistake teaches you a rule.