Ok so i’ve been playing code combat and i’ve been stuck on this level for a while now. May I have some help please?
This is what i have so far!
# Put flags where you want to build traps. # When you're not building traps, pick up coins! loop: flag = self.findFlag() if flag: # How do we get fx and fy from the flag's pos? flagpos = flag.pos fx = flag.pos.x fy = flag.pos.y self.buildXY("fire-trap", fx, fy) self.pickUpFlag(flag) else: item = self.findNearestItem() if item: pos = item.pos itemX = pos.x itemY = pos.y self.moveXY(itemX, itemY)