Advertisement
Guest User

Untitled

a guest
Nov 7th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Supermaps
  3. // @namespace    http://tampermonkey.net
  4. // @version      1.0
  5. // @description  Giant map designs
  6. // @author       Indieveloper
  7. // @include      http://tagpro-*.koalabeast.com:*
  8. // @include      http://tangent.jukejuice.com:*
  9. // @include      http://*.newcompte.fr:*
  10. // ==/UserScript==
  11.  
  12. //Some variables
  13. var maps = [];
  14. var supermapSprite;
  15.  
  16. /*
  17. HOW TO ADD A DESIGN
  18. Copy the line of one of the already included maps
  19. Put the full map name  [' in these tags ']
  20. Replace the 'src' with a URL to the map design
  21. Does the design have spikes designed on it? Then set hidespike to true, so it hides the default game spikes
  22. 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
  23.  
  24. HOW TO DISABLE A DESIGN
  25. If you want to disable a design, you can just put // in front of the line where it's defined
  26.  
  27. DEFINITION TEMPLATE
  28. maps['full map name here'] = {src:"pasteUrlHere",hidespike:true/false,x:0,y:0};
  29.  
  30. WHO MADE THIS
  31. Me
  32. */
  33.  
  34. //Map designs
  35. maps['Vardo'] = {src: "https://i.imgur.com/oZHWdkq.png", hidespike: true, x:-2, y:-1}; //Welcome to the jungle! - Made by Indieveloper
  36. maps['Cloud'] = {src: "https://i.imgur.com/HH1f1k3.png", hidespike: true, x: 0, y: 0}; //Hell Cloud - Made by Indieveloper
  37. maps['Pilot'] = {src: "https://i.imgur.com/ougFG6Q.png", hidespike: true, x: 0, y: 0}; //Road Rage - Made by Indieveloper
  38. //maps['Brute'] = {src: "image url", hidespike: true, x: 0, y: 0}; //Pirate Ship - Made by Indieveloper, idea by /u/Wilcooo
  39.  
  40. //- CODE BELOW SHOULD NOT BE EDITED UNLESS YOU WANT TO, SO I DON'T REALLY CARE ACTUALLY -//
  41.  
  42. //This code places the map, you don't have to edit anything below this
  43. function loadSupermap(mapname){
  44.     //Check if we have a design for this map
  45.     if(mapname in maps){
  46.         //Load texture and create map sprite
  47.         var texture = PIXI.Texture.fromImage(maps[mapname].src);
  48.         supermapSprite = new PIXI.Sprite(texture);
  49.  
  50.         //Set the offset position
  51.         supermapSprite.x = maps[mapname].x*40;
  52.         supermapSprite.y = maps[mapname].y*40;
  53.  
  54.         //Add design to the game layer.
  55.         //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.
  56.         tagpro.renderer.layers.midground.addChild(supermapSprite);
  57.  
  58.         if(maps[mapname].hidespike){
  59.             //Sets spike's texture position to negative, so it's basically an invisible spikes
  60.             tagpro.tiles[7].x = -1;
  61.         }
  62.     }
  63. }
  64.  
  65. //Listen for map data
  66. tagpro.ready(function() {
  67.     tagpro.socket.on("map", function(data) {
  68.         //Receive map information, and tell the supermap loader what map we got
  69.         loadSupermap(data.info.name);
  70.     });
  71. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement