6 ms·
As far as logic goes, I totally agree, but personal preference nit pick, from a code writer and reader perspective, I think all subproperty access (`hero.accele
by natecavanaugh 8y ago
As far as logic goes, I totally agree, but personal preference nit pick, from a code writer and reader perspective, I think all subproperty access (`hero.acceleration.x`) could be cached to a variable, or just operate on plain variables and assign property access after mutations and only manipulate objects as needed.
It makes the code easier to write and read, IMHO, and I believe older engines had infinitesimal changes in performance with updating objects, so it's more of a habit and code clarity thing for me.
Of course, that's far less important than the fact that the logic is clear and concise, especially after learning JS in a week :)
- tmdroid 8y agoHe did the game in a week, not learn JS from what I understand from the title
- natecavanaugh 8y agoAhh thanks for the clarification :)