# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
# Используй координаты `x` и `y` для передвижения.
hero.moveXY(x, y)
enemy = hero.findNearestEnemy()
if enemy:
pass
# Используй `buildXY` для постройки огненной ловушки в нужных координатах.
hero.buildXY("fire-trap" , 43, 50)
while True:
# Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
maybeBuildTrap(43, 50)
# Теперь вызови `maybeBuildTrap` для левого входа.
hero.buildXY("fire-trap" , 25, 34)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
hero.buildXY("fire-trap" , 43, 20)
you need to use maybeBuildTrap() inside the while loop. Don’t use any hero.buildXY in the while loop. in the def, instead of using a specific number, use x,yinside the hero.buildXY. Please let me know if this sounds confusing.
You are supposed to put hero.buildXY("fire-trap", x, y) instead of x and y coardinates. Yoy use x and y because in the finction the (x, y)is the placeholder. So you would put maybeBuildTrap(the x position here, the y position here)
# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
# Используй координаты `x` и `y` для передвижения.
hero.moveXY(x, y)
enemy = hero.findNearestEnemy()
if enemy:
pass
# Используй `buildXY` для постройки огненной ловушки в нужныхкоордината
hero.buildXY("fire-trap" , 43, 50)
while True:
# Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
maybeBuildTrap(43, 50)
# Теперь вызови `maybeBuildTrap` для левого входа.
maybeBuildTrap("fire-trap" , 25, 34)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
maybeBuildTrap("fire-trap" , 43, 20)
You are supposed to put hero.buildXY("fire-trap", x, y) instead of x and y coardinates. Yoy use x and y because in the finction the (x, y) is the placeholder. So you would put maybeBuildTrap(the x position here, the y position here)
# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
# Используй координаты `x` и `y` для передвижения.
hero.moveXY(x, y)
enemy = hero.findNearestEnemy()
if enemy:
pass
# Используй `buildXY` для постройки огненной ловушки в нужныхкоордината
hero.buildXY("fire-trap" , 43, 50)
while True:
# Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
maybeBuildTrap("fire-trap", x , y)
# Теперь вызови `maybeBuildTrap` для левого входа.
maybeBuildTrap("fire-trap" , x, y)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
maybeBuildTrap("fire-trap" , x, y)
# Функция `maybeBuildTrap` определяет два параметра!
def maybeBuildTrap(x, y):
# Используй координаты `x` и `y` для передвижения.
enemy = hero.findNearestEnemy()
if enemy:
pass
# Используй `buildXY` для постройки огненной ловушки в нужных координатах.
hero.buildXY("fire-trap", x, y)
while True:
# Здесь вызывается `maybeBuildTrap` с координатами верхнего входа.
maybeBuildTrap(43, 50)
# Теперь вызови `maybeBuildTrap` для левого входа.
maybeBuildTrap(25, 34)
# Теперь вызови `maybeBuildTrap` для нижнего входа.
maybeBuildTrap(43, 20)
он второй раз возвращается на верх для установки огненной ловушки