Need help in palimpsest


#1

game.spawnHeroXY(‘Assassin’, 30, 55)
game.setActionFor(“Assassin”, “spawn”, fightEnemies3)
game.addDefeatGoal()
game.addSurviveGoal()
def fightEnemies(event):
unit = event.target
unit.atackdamage = 20
unit.maxHealth = 50
unit.Health = 50
unit.maxSpeed = 10
while True:
unit = event.target
enemy = unit.findNearestEnemy()
if enemy:
unit.attack(enemy)

def fightEnemies3(event):
unit3 = event.target
unit3.atackdamage = 100
unit3.maxHealth = 101
unit3.Health = 101
unit3.maxSpeed = 11

def fightEnemies2(event):
unit2 = event.target
unit2.atackdamage = 10
unit2.maxHealth = 30
unit2.Health = 30
unit2.maxSpeed = 20
while True:
unit2 = event.target
enemy = unit2.findNearestEnemy()
if enemy:
unit2.attack(enemy)
game.setActionFor(“munchkin”, “spawn”, fightEnemies)
game.setActionFor(“soldier”, “spawn”, fightEnemies)
game.setActionFor(“archer”, “spawn”, fightEnemies2)
game.setActionFor(“thrower”, “spawn”, fightEnemies2)

game.spawnXY(“fence”, 36, 20)
game.spawnXY(“fence”, 36, 60)
game.spawnXY(“fence”, 36, 55)
game.spawnXY(“fence”, 36, 50)
game.spawnXY(“fence”, 36, 45)
game.spawnXY(“fence”, 36, 40)
game.spawnXY(“fence”, 36, 35)
game.spawnXY(“fence”, 36, 25)
game.spawnXY(“fence”, 36, 20)
game.spawnXY(“fence”, 36, 15)
game.spawnXY(“fence”, 36, 10)
game.spawnXY(“fence”, 36, 5)
game.spawnXY(“fire-trap”, 36, 30)
game.spawnXY(“fire-trap”, 36, 30)

def fightEnemies4(event):
unit4 = event.target
unit4.atackdamage = 99
unit4.maxHealth = 75
unit4.Health = 75
unit4.maxSpeed = 1
unit4.armor = 1
while True:
unit4 = event.target
enemy = unit4.findNearestEnemy()
if enemy:
unit4.attack(enemy)

game.setActionFor(“ogre”, “spawn”, fightEnemies4)
game.setActionFor(“champion”, “spawn”, fightEnemies4)

game.spawnXY(“ogre”, 70, 30)
game.spawnXY(“thrower”, 70, 30)
game.spawnXY(“thrower”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 70, 30)
game.spawnXY(“munchkin”, 40, 30)
game.spawnXY(“munchkin”, 70, 30)

game.spawnXY(“champion”, 30, 40)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)
game.spawnXY(“soldier”, 30, 20)


#2

Could you use the button that looks like this </> so you can properly do your code and it is easier to read?