Demo entry 6723987

1

   

Submitted by anonymous on Mar 25, 2018 at 11:55
Language: Java. Code size: 431 Bytes.

//只有墙和目标
            if (fixedPositions.length==2) {
                if (movingPositions==null) {
                    //如果已经取到钥匙,只算NPC与目标的距离即可
                    distanceSum = goalPosition.dist(npcPosition);
                } else{
                    //如果未取到钥匙,需要计算NPC与钥匙的距离,以及NPC与目标的距离之和
                    distanceSum = keyPosition.dist(npcPosition) + goalPosition.dist(npcPosition);
                }

            }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).