1

我的findPath功能有点问题。

我正在混合使用两个教程(一个来自 Haxeflixel,第二个来自 haxecoder),第二个使用 CSV 而不是 Ogmo,并findPath在单击时使用 a。

但是当我点击时,游戏崩溃了,很好。

这是我的代码:http ://hastebin.com/xunidubiyi.avrasm

问题出在第 86 行(分成多行以适应宽度):

var nodes:Array<FlxPoint> = _mWalls.findPath(
  FlxPoint.get(
    _player.x + 16 / 2,
    _player.y + 16 / 2
  ),
  FlxPoint.get(
    tileCoordX * 16 + 16 / 2,
    tileCoordY * 16 + 16 / 2
  )
);

输出:

Invalid field access : allowCollisions
Called from flixel.tile.FlxTilemap::computePathDistance line 1806
Called from flixel.tile.FlxTilemap::findPath line 796
Called from PlayState::update line 87
Called from flixel.FlxState::tryUpdate line 155
Called from flixel.FlxGame::update line 700
Called from flixel.FlxGame::step line 648
Called from flixel.FlxGame::onEnterFrame line 493
Called from openfl._legacy.events.EventDispatcher::dispatchEvent line 98
Called from openfl._legacy.display.DisplayObject::__dispatchEvent line 182
Called from openfl._legacy.display.DisplayObject::__broadcast line 161
Called from openfl._legacy.display.DisplayObjectContainer::__broadcast line 286
Called from openfl._legacy.display.Stage::__render line 1103
Called from openfl._legacy.display.Stage::__checkRender line 351
Called from openfl._legacy.display.Stage::__pollTimers line 1084
Called from openfl._legacy.display.Stage::__doProcessStageEvent line 430
Done(1)

有谁知道出了什么问题,为什么?

4

0 回答 0