PR fixes
This commit is contained in:
parent
3cc38e6bbe
commit
b5887bceb4
@ -65,3 +65,20 @@ How to use entry point :
|
||||
|
||||
* To enter via this entry point, simply add a hash with the entry point name to the URL ("#[_entryPointName_]"). For instance: "`https://workadventu.re/_/global/mymap.com/path/map.json#my-entry-point`".
|
||||
* You can of course use the "#" notation in an exit scene URL (so an exit scene URL will point to a given entry scene URL)
|
||||
|
||||
## Defining destination point with moveTo parameter
|
||||
|
||||
We are able to direct WOKA to the desired place immediately after spawn. To make users spawn on entry point and the go to the, for example, meeting room automatically, simply add `moveTo` as an additional parameter of URL:
|
||||
|
||||
*Use default entry point*
|
||||
```
|
||||
.../my_map.json#&moveTo=exit
|
||||
```
|
||||
*Define entry point and moveTo parameter*
|
||||
```
|
||||
.../my_map.json#start&moveTo=meeting-room
|
||||
```
|
||||
|
||||
For this to work, moveTo must be equal to the layer name of interest. This layer should have at least one tile defined. In case of layer having many tiles, user will go to one of them, randomly selected.
|
||||
|
||||
![](images/moveTo-layer-example.png)
|
BIN
docs/maps/images/moveTo-layer-example.png
Normal file
BIN
docs/maps/images/moveTo-layer-example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
@ -1727,15 +1727,19 @@ ${escapedMessage}
|
||||
});
|
||||
const moveToParam = urlManager.getHashParameter("moveTo");
|
||||
if (moveToParam) {
|
||||
const endPos = this.gameMap.getRandomPositionFromLayer(moveToParam);
|
||||
this.pathfindingManager
|
||||
.findPath(this.gameMap.getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y), endPos)
|
||||
.then((path) => {
|
||||
if (path && path.length > 0) {
|
||||
this.CurrentPlayer.setPathToFollow(path).catch((reason) => console.warn(reason));
|
||||
}
|
||||
})
|
||||
.catch((reason) => console.warn(reason));
|
||||
try {
|
||||
const endPos = this.gameMap.getRandomPositionFromLayer(moveToParam);
|
||||
this.pathfindingManager
|
||||
.findPath(this.gameMap.getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y), endPos)
|
||||
.then((path) => {
|
||||
if (path && path.length > 0) {
|
||||
this.CurrentPlayer.setPathToFollow(path).catch((reason) => console.warn(reason));
|
||||
}
|
||||
})
|
||||
.catch((reason) => console.warn(reason));
|
||||
} catch (err) {
|
||||
console.warn(`Cannot proceed with moveTo command:\n\t-> ${err}`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (err instanceof TextureError) {
|
||||
|
Loading…
Reference in New Issue
Block a user