circleTexture: CanvasTexture;
private initPosition: PositionInterface|null = null;
private playersPositionInterpolator = new PlayersPositionInterpolator();
+ active: boolean;
MapKey: string;
MapUrlFile: string;
//hook create scene
create(): void {
//initalise map
+ this.active = false;
this.Map = this.add.tilemap(this.MapKey);
this.mapFile.tilesets.forEach((tileset: ITiledTileSet) => {
this.Terrains.push(this.Map.addTilesetImage(tileset.name, tileset.name));
this.currentTick = time;
this.CurrentPlayer.moveUser(delta);
+ // get tile under currentUser center position, on layer name "override"
+ let tile = this.Map.getTileAt(this.Map.worldToTileX(this.CurrentPlayer.x), this.Map.worldToTileY(this.CurrentPlayer.y), true, "override");
+ if (tile !== null){
+ let active = (tile.index > 0);
+ if (this.active != active){
+
+ let url = tile.properties["url"];
+ let say = tile.properties["say"];
+
+ if (url === undefined){
+ url="https://play.testansible.fsf.org/resources/welcomepage/index.html";
+ this.active = false;
+ document.getElementById("webRtc").style.pointerEvents="none";
+ }else{
+ document.getElementById("webRtc").style.pointerEvents="all";
+ }
+
+ if (say !== undefined){
+ this.CurrentPlayer.say(say)
+ };
+
+ document.getElementById("theiframe").src = url;
+ this.active = active;
+ }
+ }
+
// Let's move all users
let updatedPlayersPositions = this.playersPositionInterpolator.getUpdatedPositions(time);
updatedPlayersPositions.forEach((moveEvent: HasMovedEvent, userId: string) => {