First this level is madness and I love it lol.
Second, if any of you code geniuses can help me implement, what I myself have failed to do for the last six hours, I’d greatly appreciate it.
*Idea - have two peasants collecting coins for me, the first on the top half of the screen, the second on the bottom half. I have all of my summonables coded with concepts I learned in the mountain level. I have them loop over the three towers and defend, I have a types array like[“soldier”,“archer”,“archer”, “etc”] and that works perfect. Its the code below, that Ive tried a dozen different ways, that I cant seem to get working.
def peasantCommand():
peasantArray = []
friends = hero.findFriends()
for friend in friends:
if friend.type == "peasant":
peasantArray.append(friend)
if friend == peasantArray[0]:
#do this
if friend == peasantArray[1]:
#do that
# How do I make this concept work, the way I want it, without an infinite loop or an error?