Show HN: Yare.io – game where you control units with JavaScript
Very nice so far.<p>I noticed a small problem in the tutorial. On step 3 or 4, when the suggested code is<p>if (s1.energy == s1.energy_capacity){<p>memory[s1.id] = "charging";<p>} else if (s1.energy == 0){<p>memory[s1.id] = "harvesting";<p>}<p>if (memory[s1.id] == "charging"){<p>s1.move(base.position);<p>s1.energize(base);<p>} else if (memory[s1.id] == "harvesting"){<p>s1.move(star_zxq.position);<p>s1.energize(s1);<p>}<p>My spirit had already transferred a bit of energy to the base, so it entered neither of the states. It was a pretty easy fix to make, but strictly following along the instructions, I would have been stuck there.