How do you be "Idle" In Mages Might?

Java is never short for JavaScript. As Eric_Tang said, Java is an entirely separate language with practically no similarities with JavaScript, and I can assure you most people (like me) who would be happy to help with JavaScript had no idea you were asking for help with it. One of the CodeCombat loading tips, in fact, reads “Java is to JavaScript as car is to carpet.”

Direct translation of my previous sample code:

// Untested Code

while (true) {
  if (hero.time < 50) // For the first 50 seconds, only spawn collectors
    hero.spawnCollector()

  if (hero.time > 90) // After 1:30, attempt to cast fire balls
    if (hero.canCast("fire-ball"))
      hero.cast("fire-ball")

  // Note:
  //   If the time is between 50 seconds and 90 seconds, we do nothing (idle)
  //   If >90 seconds and we cannot afford a fire ball, we will also idle
}
2 Likes