搜题
问题   更新时间2023/4/3 12:59:00

假设:追逐者坐标(predatorX, predatorY), 猎物坐标(preyX,preyY),请写出砖块环境下基本追逐算法

if(predatorX > preyX) predatorX--; else if(predatorX < preyX) predatorX++; if(predatorY > preyY) predatorY--; else if(predatorY < preyY) predatorY++;
王老师:19139051760(拨打)