Experimenting with a gather.town frontend client scripting to implement things like:
drawMapAllPlayers.js
: An interactive minimap (with live heatmap of player positions)autoMove.js
: A script that moves the player automatically in a set pattern of directions (or a random pattern)playerInteracts.ts
: A script that logs data about player interactions with objects in a given spacegoKartStation.js
: A script that manages a custom goKart Station objectcoordinatesLogger.js
: A script that enables logging and monitoring map coordinates interactivelybecomeGoKart.js
: A script that removes and restores the players outfit when he gets on a vehicleteleportAllPlayers.js
: A script that will prompt the user for a map number to then teleport all players in a gather.town space into.measureSpeakingTimes.js
: A script that measures speaking times for all players based on the playerActivelySpeaks events firing in a space.confettiHitDetection.js
: A script that checks for players in the range of the confetti effect and subscribes to the playerShootsConfetti event, triggering a notification.mapCollisionsToString.js
: A script that converts from map collision data to base64 string data expected by some Gather.Town API methods.getAvatarImage.js
: A script that takes the player's outfitString, converts it into an ordered list of outfitLayers and requests an avatar's spritesheet or profile image from gather.town's dynamic-assets endpoint.isMovingNearObjects.js
: A script that demonstrates a playerMoves subscription that logs objects within two squares from the player who moved. This also demonstrates how subscriptions can be cancelled and how events can be filtered from within the game.subscribeToEvent call itself.findMatchingObjects.js
: A script that finds all objects in the space with any property value including a given string (quickly searches through all property values for every object in a space)mapTileSelector.js
: A (client-side) script relying on the HTML Canvas to take a map's background image, break it into tiles associated with the gather.town coordinate system and then filter them based on a set of HEX color thresholds. Ex: filter all map tiles containing at least 60% of color f2f2f2 and 10% of color whatever.
v2 roadmap
- Possibly have a mode that renders all maps in a given space simultaneously
- Or allows you to select a given map or a list of maps to render
- Have a toggle that triggers objects / portals / etc rendering
v3 roadmap
- Have a toggle that triggers heatmap layer rendering
- Handle whether the player has already entered the game or not, in order to get it running on page startup without any problems
* this includes toggling visibility / deleting the canvas if the player leaves the game
* consider browser navigation / URL change event to stop minimap interval check
* NEED to find out how to intercept the clicking on the sign OUT button, to avoid late destruction of the map
v1 roadmap
- Include a button on the UI to hide / show the minimap
- Possibly include a zoom feature to allow for the minimap to be scaled up or down in real-time (could be achieved by buttons)
- Allow dragging the minimap to reposition it (and a button to reset the minimap's position and scale)
v2 roadmap
- Consider the impact and usability of displaying other players on the minimap
- Add debug function
- Teleport directly to the coordinate clicked
- View players names on mouseover
- Highlight certain important types / kinds of objects (ex: portals, interactive objects)
- render function could be broken into steps, for better legibility, and wrapped by a wrapper (render players, render map, render objects, etc)
- Implement a heatmap view of player movement / player positions
No known bugs to report at the moment