Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Supermaps
- // @namespace http://tampermonkey.net
- // @version 1.0
- // @description Giant map designs
- // @author Indieveloper
- // @include http://tagpro-*.koalabeast.com:*
- // @include http://tangent.jukejuice.com:*
- // @include http://*.newcompte.fr:*
- // ==/UserScript==
- //Some variables
- var maps = [];
- var supermapSprite;
- /*
- HOW TO ADD A DESIGN
- Copy the line of one of the already included maps
- Put the full map name [' in these tags ']
- Replace the 'src' with a URL to the map design
- Does the design have spikes designed on it? Then set hidespike to true, so it hides the default game spikes
- Possibly you would need to adjust the x and y offset of the map design, this is mostly just testing, try 0,0 first. The offset is in tile units
- HOW TO DISABLE A DESIGN
- If you want to disable a design, you can just put // in front of the line where it's defined
- DEFINITION TEMPLATE
- maps['full map name here'] = {src:"pasteUrlHere",hidespike:true/false,x:0,y:0};
- WHO MADE THIS
- Me
- */
- //Map designs
- maps['Vardo'] = {src: "https://i.imgur.com/oZHWdkq.png", hidespike: true, x:-2, y:-1}; //Welcome to the jungle! - Made by Indieveloper
- maps['Cloud'] = {src: "https://i.imgur.com/HH1f1k3.png", hidespike: true, x: 0, y: 0}; //Hell Cloud - Made by Indieveloper
- maps['Pilot'] = {src: "https://i.imgur.com/ougFG6Q.png", hidespike: true, x: 0, y: 0}; //Road Rage - Made by Indieveloper
- //maps['Brute'] = {src: "image url", hidespike: true, x: 0, y: 0}; //Pirate Ship - Made by Indieveloper, idea by /u/Wilcooo
- //- CODE BELOW SHOULD NOT BE EDITED UNLESS YOU WANT TO, SO I DON'T REALLY CARE ACTUALLY -//
- //This code places the map, you don't have to edit anything below this
- function loadSupermap(mapname){
- //Check if we have a design for this map
- if(mapname in maps){
- //Load texture and create map sprite
- var texture = PIXI.Texture.fromImage(maps[mapname].src);
- supermapSprite = new PIXI.Sprite(texture);
- //Set the offset position
- supermapSprite.x = maps[mapname].x*40;
- supermapSprite.y = maps[mapname].y*40;
- //Add design to the game layer.
- //You could modify this to add support for another layer that renders above the whole map, might be cool for letting players move under trees for example.
- tagpro.renderer.layers.midground.addChild(supermapSprite);
- if(maps[mapname].hidespike){
- //Sets spike's texture position to negative, so it's basically an invisible spikes
- tagpro.tiles[7].x = -1;
- }
- }
- }
- //Listen for map data
- tagpro.ready(function() {
- tagpro.socket.on("map", function(data) {
- //Receive map information, and tell the supermap loader what map we got
- loadSupermap(data.info.name);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement