I have decided to try and use vectors but i cannot seem to use it correctly.
The first thing that it said was ‘append’ it to the list.
so, i tried to do enemy.append("sand-yak")
but that didn’t work. what should i do to fix this?
My code
# That's a lot of Yaks!
# If you are to survive, you'll need to filter out Yaks...
def removeByType(enemies, excludedType):
tempList = []
# Go through each enemy and check to see if its type is excludedType.
for enemy in enemies:
# If it isn't, 'append' it to the list.
Vector.add(enemy.type, tempList)
pass
return tempList
while True:
# Find the enemies!
enemies = hero.findEnemies()
# Remove those pesky Yaks.
enemies = removeByType(enemies, "sand-yak")
enemy = hero.findNearest(enemies)
if enemy:
# Now... 'remove' those enemies.
hero.attack(enemy)