本帖最后由 soulsaga 于 2019-4-2 19:13 编辑 nxy=[] a=$game_variables[4]+$game_variables[5]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) a=$game_variables[6]+$game_variables[7]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) a=$game_variables[8]+$game_variables[9]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) a=$game_variables[10]+$game_variables[11]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) a=$game_variables[12]+$game_variables[13]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) a=$game_variables[14]+$game_variables[15]-$game_variables[2]+$game_variables[3] nxy.push(a.abs) $game_variables[100]=nxy.index(nxy.min) |
本帖最后由 灯笼菜刀王 于 2019-4-2 19:44 编辑 a = 9999 id = 0 e = $game_map.events for j in 4..9 b=(e[j].x-e[2].x).abs+(e[j].y-e[2].y).abs if b < a id = j a = b end end $game_variables[1] = id 最后 id 的值就是当前最接近2号的ID 带入变量1号 |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-27 10:32
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.