Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

The Two Flowers



Hector is the peasant, he won’t attack, he just tries to evade ogres. You don’t need to give him any commands. :slight_smile:


Since you are the hero, then you can refer to the hero with self (Python, Lua), this (JavaScript, Clojure), or @ (CoffeeScript). This means that everytime you type self, this, or @ into the code editor, it is referring to you, the hero of the game.

self==hero==“Anya” ?


self.command(soldier, "attack", enemy)

Yes, self is Anya. Who is soldier?



def commandSoldiers():
    for soldier in soldiers:
        enemy = soldier.findNearestEnemy()
        self.command(soldier, "attack", enemy)