Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.01 KB | None | 0 0
  1. geo = {"code": "eg", "lat": 30.044281, "lon": 31.340002}
  2. var room = HBInit({ roomName: "🏆 HaxSpace Community Spacemap 🏆", maxPlayers: 16, playerName : "HaxSpace", public : true, geo});
  3. var spaceball = '{"name" : "SpaceBall HaxSpace from HaxMaps","width" : 900,"height" : 540,"spawnDistance" : 350,"bg" : { "type" : "hockey", "width" : 550, "height" : 240, "kickOffRadius" : 0, "cornerRadius" : 0 },"vertexes" : [{"x" : -550,"y" : 240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : 80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : -80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : -240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : 240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : 80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : -80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : -240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 0,"y" : 540,"trait" : "kick_off_invisible" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -540,"trait" : "kick_off_invisible" },{"x" : -560,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -580,"y" : -60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -580,"y" : 60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -560,"y" : 80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 560,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 580,"y" : -60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 580,"y" : 60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 560,"y" : 80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -557.5,"y" : 247.5,"trait" : "ball_area2" },{"x" : -557.5,"y" : 80,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -557.5,"y" : -80,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -557.5,"y" : -247.5,"trait" : "ball_area2" },{"x" : -565,"y" : 255,"trait" : "ball_area3" },{"x" : -565,"y" : 80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -565,"y" : -80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -565,"y" : -255,"trait" : "ball_area3" },{"x" : 557.5,"y" : 247.5,"trait" : "ball_area2" },{"x" : 557.5,"y" : 80,"trait" : "ball_area2" },{"x" : 557.5,"y" : -80,"trait" : "ball_area2" },{"x" : 557.5,"y" : -247.5,"trait" : "ball_area2" },{"x" : 565,"y" : 255,"trait" : "ball_area3" },{"x" : 565,"y" : 80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 565,"y" : -80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 565,"y" : -255,"trait" : "ball_area3" },{"x" : 0,"y" : 240,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : -240,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : -97,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -97,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -79,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -79,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -97,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -78,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -56,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -66,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -49,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -63,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -51,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 36.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0,"color" : "B2C8DB" },{"x" : 54,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -5 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 124,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 124,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 91,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 81,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 98,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 86,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 96,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"segments" : [{"v0" : 8,"v1" : 9,"trait" : "kick_off_invisible" },{"v0" : 9,"v1" : 10,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 9,"v1" : 10,"curve" : -180,"color" : "B2C8DB","cGroup" : ["redKO"],"trait" : "kick_off_visible" },{"v0" : 10,"v1" : 11,"trait" : "kick_off_invisible" },{"v0" : 36,"v1" : 37,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 1,"v1" : 2,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 5,"v1" : 6,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 0,"v1" : 1,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 2,"v1" : 3,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 4,"v1" : 5,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 6,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 0,"v1" : 4,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 3,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 20,"v1" : 21,"trait" : "ball_area2" },{"v0" : 22,"v1" : 23,"trait" : "ball_area2" },{"v0" : 28,"v1" : 29,"trait" : "ball_area2" },{"v0" : 30,"v1" : 31,"trait" : "ball_area2" },{"v0" : 23,"v1" : 31,"trait" : "ball_area2" },{"v0" : 20,"v1" : 28,"trait" : "ball_area2" },{"v0" : 24,"v1" : 25,"trait" : "ball_area3" },{"v0" : 26,"v1" : 27,"trait" : "ball_area3" },{"v0" : 32,"v1" : 33,"trait" : "ball_area3" },{"v0" : 34,"v1" : 35,"trait" : "ball_area3" },{"v0" : 27,"v1" : 35,"trait" : "ball_area3" },{"v0" : 24,"v1" : 32,"trait" : "ball_area3" },{"v0" : 12,"v1" : 13,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 13,"v1" : 14,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 14,"v1" : 15,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 16,"v1" : 17,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 17,"v1" : 18,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 18,"v1" : 19,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 38,"v1" : 39,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 40,"v1" : 41,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 42,"v1" : 43,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 44,"v1" : 45,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 47,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 48,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 49,"v1" : 50,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 53,"v1" : 54,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 51,"v1" : 52,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 55,"v1" : 56,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 56,"v1" : 57,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 57,"v1" : 60,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 59,"v1" : 58,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 62,"v1" : 61,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 63,"v1" : 64,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 65,"v1" : 66,"curve" : -5,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 67,"v1" : 68,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 68,"v1" : 69,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 69,"v1" : 72,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 71,"v1" : 70,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 74,"v1" : 73,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 75,"v1" : 76,"curve" : -200,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 78,"v1" : 77,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 80,"v1" : 79,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 82,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 83,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 84,"v1" : 85,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"goals" : [{"p0" : [-550,80],"p1" : [-550,-80],"team" : "red" },{"p0" : [549,80],"p1" : [549,-80],"team" : "blue" }],"discs" : [{"pos" : [-550,80],"color" : "961515","trait" : "goal_post" },{"pos" : [-550,-80],"color" : "961515","trait" : "goal_post" },{"pos" : [550,80],"color" : "1E1666","trait" : "goal_post" },{"pos" : [550,-80],"color" : "1E1666","trait" : "goal_post" }],"planes" : [{"normal" : [0,1],"dist" : -540,"bCoef" : 0.1 },{"normal" : [0,-1],"dist" : -540,"bCoef" : 0.1 },{"normal" : [1,0],"dist" : -900,"bCoef" : 0.1 },{"normal" : [-1,0],"dist" : -900,"bCoef" : 0.1 }],"traits" : {"ball_area1" : {"vis" : true,"bCoef" : 1,"cMask" : ["ball"],"color" : "000000" },"ball_area2" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"ball_area3" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"goal_post" : {"radius" : 8,"invMass" : 0,"bCoef" : 0.5,"color" : "A300DA" },"goal_net" : {"vis" : true,"bCoef" : 0.1,"cMask" : ["ball"],"color" : "000000" },"kick_off_visible" : {"vis" : true,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"],"color" : "606060" },"kick_off_invisible" : {"vis" : false,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"] },"coverup" : {"vis" : true,"color" : "808080","cMask" : [""] } },"playerPhysics" : {"bCoef" : 0.5,"invMass" : 0.5,"damping" : 0.9995,"acceleration" : 0.025,"kickingAcceleration" : 0.0175,"kickingDamping" : 0.9995,"kickStrength" : 5 },"ballPhysics" : {"radius" : 10,"bCoef" : 0.5,"invMass" : 1,"damping" : 0.99,"color" : "FFFFFF","cMask" : ["all"],"cGroup" : ["ball"] } }';
  4. var spacebounce = '{"name" : "SpaceBounce HaxSpace from HaxMaps","width" : 900,"height" : 540,"spawnDistance" : 350,"bg" : { "type" : "hockey", "width" : 550, "height" : 240, "kickOffRadius" : 0, "cornerRadius" : 0 },"vertexes" : [{"x" : -550,"y" : 240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : 80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : -80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -550,"y" : -240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : 240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : 80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : -80,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 550,"y" : -240,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 0,"y" : 540,"trait" : "kick_off_invisible" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -540,"trait" : "kick_off_invisible" },{"x" : -560,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -580,"y" : -60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -580,"y" : 60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -560,"y" : 80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 560,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 580,"y" : -60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 580,"y" : 60,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 560,"y" : 80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -557.5,"y" : 247.5,"trait" : "ball_area2" },{"x" : -557.5,"y" : 80,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -557.5,"y" : -80,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -557.5,"y" : -247.5,"trait" : "ball_area2" },{"x" : -565,"y" : 255,"trait" : "ball_area3" },{"x" : -565,"y" : 80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -565,"y" : -80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -565,"y" : -255,"trait" : "ball_area3" },{"x" : 557.5,"y" : 247.5,"trait" : "ball_area2" },{"x" : 557.5,"y" : 80,"trait" : "ball_area2" },{"x" : 557.5,"y" : -80,"trait" : "ball_area2" },{"x" : 557.5,"y" : -247.5,"trait" : "ball_area2" },{"x" : 565,"y" : 255,"trait" : "ball_area3" },{"x" : 565,"y" : 80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 565,"y" : -80,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 565,"y" : -255,"trait" : "ball_area3" },{"x" : 0,"y" : 240,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : -240,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : -97,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -97,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -79,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -79,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -97,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -78,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -56,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -66,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -49,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -63,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -51,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 36.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0,"color" : "B2C8DB" },{"x" : 54,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -5 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 124,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 124,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 91,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 81,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 98,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 86,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 96,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"segments" : [{"v0" : 8,"v1" : 9,"trait" : "kick_off_invisible" },{"v0" : 9,"v1" : 10,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 9,"v1" : 10,"curve" : -180,"color" : "B2C8DB","cGroup" : ["redKO"],"trait" : "kick_off_visible" },{"v0" : 10,"v1" : 11,"trait" : "kick_off_invisible" },{"v0" : 36,"v1" : 37,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 1,"v1" : 2,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 5,"v1" : 6,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 0,"v1" : 1,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 2,"v1" : 3,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 4,"v1" : 5,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 6,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 0,"v1" : 4,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 3,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 20,"v1" : 21,"trait" : "ball_area2" },{"v0" : 22,"v1" : 23,"trait" : "ball_area2" },{"v0" : 28,"v1" : 29,"trait" : "ball_area2" },{"v0" : 30,"v1" : 31,"trait" : "ball_area2" },{"v0" : 23,"v1" : 31,"trait" : "ball_area2" },{"v0" : 20,"v1" : 28,"trait" : "ball_area2" },{"v0" : 24,"v1" : 25,"trait" : "ball_area3" },{"v0" : 26,"v1" : 27,"trait" : "ball_area3" },{"v0" : 32,"v1" : 33,"trait" : "ball_area3" },{"v0" : 34,"v1" : 35,"trait" : "ball_area3" },{"v0" : 27,"v1" : 35,"trait" : "ball_area3" },{"v0" : 24,"v1" : 32,"trait" : "ball_area3" },{"v0" : 12,"v1" : 13,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 13,"v1" : 14,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 14,"v1" : 15,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 16,"v1" : 17,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 17,"v1" : 18,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 18,"v1" : 19,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 38,"v1" : 39,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 40,"v1" : 41,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 42,"v1" : 43,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 44,"v1" : 45,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 47,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 48,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 49,"v1" : 50,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 53,"v1" : 54,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 51,"v1" : 52,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 55,"v1" : 56,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 56,"v1" : 57,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 57,"v1" : 60,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 59,"v1" : 58,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 62,"v1" : 61,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 63,"v1" : 64,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 65,"v1" : 66,"curve" : -5,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 67,"v1" : 68,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 68,"v1" : 69,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 69,"v1" : 72,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 71,"v1" : 70,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 74,"v1" : 73,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 75,"v1" : 76,"curve" : -200,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 78,"v1" : 77,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 80,"v1" : 79,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 82,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 83,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 84,"v1" : 85,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"goals" : [{"p0" : [-550,80],"p1" : [-550,-80],"team" : "red" },{"p0" : [549,80],"p1" : [549,-80],"team" : "blue" }],"discs" : [{"pos" : [-550,80],"color" : "961515","trait" : "goal_post" },{"pos" : [-550,-80],"color" : "961515","trait" : "goal_post" },{"pos" : [550,80],"color" : "1E1666","trait" : "goal_post" },{"pos" : [550,-80],"color" : "1E1666","trait" : "goal_post" }],"planes" : [{"normal" : [0,1],"dist" : -540,"bCoef" : 0.1 },{"normal" : [0,-1],"dist" : -540,"bCoef" : 0.1 },{"normal" : [1,0],"dist" : -900,"bCoef" : 0.1 },{"normal" : [-1,0],"dist" : -900,"bCoef" : 0.1 }],"traits" : {"ball_area1" : {"vis" : true,"bCoef" : 1,"cMask" : ["ball"],"color" : "000000" },"ball_area2" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"ball_area3" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"goal_post" : {"radius" : 8,"invMass" : 0,"bCoef" : 0.5,"color" : "A300DA" },"goal_net" : {"vis" : true,"bCoef" : 0.1,"cMask" : ["ball"],"color" : "000000" },"kick_off_visible" : {"vis" : true,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"],"color" : "606060" },"kick_off_invisible" : {"vis" : false,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"] },"coverup" : {"vis" : true,"color" : "808080","cMask" : [""] } },"playerPhysics" : {"bCoef" : 1.5,"invMass" : 0.5,"damping" : 0.9995,"acceleration" : 0.025,"kickingAcceleration" : 0.0175,"kickingDamping" : 0.9995,"kickStrength" : 5 },"ballPhysics" : {"radius" : 10,"bCoef" : 0.5,"invMass" : 1,"damping" : 0.99,"color" : "FFFFFF","cMask" : ["all"],"cGroup" : ["ball"] } }';
  5. var spaceballv5 = '{"name" : "SpaceBall HaxSpace v5 from HaxMaps","width" : 1700,"height" : 850,"spawnDistance" : 350,"bg" : { "type" : "hockey", "width" : 1100, "height" : 480, "kickOffRadius" : 0, "cornerRadius" : 0 },"vertexes" : [{"x" : -1100,"y" : 480,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -1100,"y" : 100,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -1100,"y" : -100,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : -1100,"y" : -480,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 1100,"y" : 480,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 1100,"y" : 100,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 1100,"y" : -100,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 1100,"y" : -480,"trait" : "ball_area1","color" : "C4C4C4" },{"x" : 0,"y" : 1100,"trait" : "kick_off_invisible" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -1100,"trait" : "kick_off_invisible" },{"x" : -1110,"y" : -100,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -1130,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -1130,"y" : 80,"trait" : "goal_net","color" : "C4C4C4","_selected" : true },{"x" : -1110,"y" : 100,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 1110,"y" : -100,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 1130,"y" : -80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 1130,"y" : 80,"trait" : "goal_net","color" : "C4C4C4" },{"x" : 1110,"y" : 100,"trait" : "goal_net","color" : "C4C4C4" },{"x" : -1107.5,"y" : 487.5,"trait" : "ball_area2" },{"x" : -1107.5,"y" : 100,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -1107.5,"y" : -100,"trait" : "ball_area2","color" : "C4C4C4" },{"x" : -1107.5,"y" : -487.5,"trait" : "ball_area2" },{"x" : -1115,"y" : 495,"trait" : "ball_area3" },{"x" : -1115,"y" : 100,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -1115,"y" : -100,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : -1115,"y" : -495,"trait" : "ball_area3" },{"x" : 1107.5,"y" : 487.5,"trait" : "ball_area2" },{"x" : 1107.5,"y" : 100,"trait" : "ball_area2" },{"x" : 1107.5,"y" : -100,"trait" : "ball_area2" },{"x" : 1107.5,"y" : -487.5,"trait" : "ball_area2" },{"x" : 1115,"y" : 495,"trait" : "ball_area3" },{"x" : 1115,"y" : 100,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 1115,"y" : -100,"trait" : "ball_area3","color" : "C4C4C4" },{"x" : 1115,"y" : -495,"trait" : "ball_area3" },{"x" : 0,"y" : 480,"bCoef" : 0.1,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : -480,"trait" : "coverup","color" : "C4C4C4" },{"x" : 0,"y" : 80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : 0,"y" : -80,"trait" : "kick_off_visible","color" : "B2C8DB" },{"x" : -97,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -97,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : -79,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -79,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -97,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -78,"y" : 210.5,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -56,"y" : 197,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -66,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -49,"y" : 225,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -63,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -51,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -35,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : -18,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 36.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 19,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 36.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0,"color" : "B2C8DB" },{"x" : 54,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -5 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 155.5,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 138,"y" : 210,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 124,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 124,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : -200 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 53,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 209,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 70,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","curve" : 0 },{"x" : 91,"y" : 196,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 81,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 98,"y" : 224,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 86,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"x" : 96,"y" : 211,"bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"segments" : [{"v0" : 8,"v1" : 9,"trait" : "kick_off_invisible" },{"v0" : 9,"v1" : 10,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 9,"v1" : 10,"curve" : -180,"color" : "B2C8DB","cGroup" : ["redKO"],"trait" : "kick_off_visible" },{"v0" : 10,"v1" : 11,"trait" : "kick_off_invisible" },{"v0" : 36,"v1" : 37,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 1,"v1" : 2,"color" : "C4C4C4","trait" : "coverup" },{"v0" : 5,"v1" : 6,"color" : "C4C4C4","trait" : "coverup","x" : 850 },{"v0" : 0,"v1" : 1,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 2,"v1" : 3,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 4,"v1" : 5,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 6,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 0,"v1" : 4,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 3,"v1" : 7,"color" : "C4C4C4","trait" : "ball_area1" },{"v0" : 20,"v1" : 21,"trait" : "ball_area2" },{"v0" : 22,"v1" : 23,"trait" : "ball_area2" },{"v0" : 28,"v1" : 29,"trait" : "ball_area2" },{"v0" : 30,"v1" : 31,"trait" : "ball_area2" },{"v0" : 23,"v1" : 31,"trait" : "ball_area2" },{"v0" : 20,"v1" : 28,"trait" : "ball_area2" },{"v0" : 24,"v1" : 25,"trait" : "ball_area3" },{"v0" : 26,"v1" : 27,"trait" : "ball_area3" },{"v0" : 32,"v1" : 33,"trait" : "ball_area3" },{"v0" : 34,"v1" : 35,"trait" : "ball_area3" },{"v0" : 27,"v1" : 35,"trait" : "ball_area3" },{"v0" : 24,"v1" : 32,"trait" : "ball_area3" },{"v0" : 12,"v1" : 13,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 13,"v1" : 14,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 14,"v1" : 15,"curve" : -90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 16,"v1" : 17,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 17,"v1" : 18,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 18,"v1" : 19,"curve" : 90,"color" : "C4C4C4","trait" : "goal_net" },{"v0" : 38,"v1" : 39,"curve" : 180,"color" : "B2C8DB","cGroup" : ["blueKO"],"trait" : "kick_off_visible" },{"v0" : 40,"v1" : 41,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 42,"v1" : 43,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 44,"v1" : 45,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 47,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 46,"v1" : 48,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 49,"v1" : 50,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 53,"v1" : 54,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 51,"v1" : 52,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 55,"v1" : 56,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 56,"v1" : 57,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 57,"v1" : 60,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 59,"v1" : 58,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 62,"v1" : 61,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 63,"v1" : 64,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 65,"v1" : 66,"curve" : -5,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 67,"v1" : 68,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 180 },{"v0" : 68,"v1" : 69,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 69,"v1" : 72,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 71,"v1" : 70,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 74,"v1" : 73,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 75,"v1" : 76,"curve" : -200,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 78,"v1" : 77,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup","y" : 222 },{"v0" : 80,"v1" : 79,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 82,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 81,"v1" : 83,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" },{"v0" : 84,"v1" : 85,"curve" : 0,"vis" : true,"color" : "B2C8DB","bCoef" : 0.1,"cMask" : ["wall"],"cGroup" : ["red","blue"],"trait" : "coverup" }],"goals" : [{"p0" : [-1099,100],"p1" : [-1099,-100],"team" : "red" },{"p0" : [1099,100],"p1" : [1099,-100],"team" : "blue" }],"discs" : [{"pos" : [-1101,99],"color" : "961515","trait" : "goal_post" },{"pos" : [-1101,-101],"color" : "961515","trait" : "goal_post" },{"pos" : [1100,100],"color" : "1E1666","trait" : "goal_post" },{"pos" : [1101,-103],"color" : "1E1666","trait" : "goal_post" }],"planes" : [{"normal" : [0,1],"dist" : -850,"bCoef" : 0.1 },{"normal" : [0,-1],"dist" : -850,"bCoef" : 0.1 },{"normal" : [1,0],"dist" : -1700,"bCoef" : 0.1 },{"normal" : [-1,0],"dist" : -1700,"bCoef" : 0.1 }],"traits" : {"ball_area1" : {"vis" : true,"bCoef" : 1,"cMask" : ["ball"],"color" : "000000" },"ball_area2" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"ball_area3" : {"vis" : false,"bCoef" : 1,"cMask" : ["ball"] },"goal_post" : {"radius" : 8,"invMass" : 0,"bCoef" : 0.5,"color" : "A300DA" },"goal_net" : {"vis" : true,"bCoef" : 0.1,"cMask" : ["ball"],"color" : "000000" },"kick_off_visible" : {"vis" : true,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"],"color" : "606060" },"kick_off_invisible" : {"vis" : false,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"] },"coverup" : {"vis" : true,"color" : "808080","cMask" : [""] } },"playerPhysics" : {"bCoef" : 0.5,"invMass" : 0.5,"damping" : 0.9995,"acceleration" : 0.025,"kickingAcceleration" : 0.0175,"kickingDamping" : 0.9995,"kickStrength" : 5 },"ballPhysics" : {"radius" : 10,"bCoef" : 0.5,"invMass" : 1,"damping" : 0.99,"color" : "FFFFFF","cMask" : ["all"],"cGroup" : ["ball"] } }';
  6. room.setScoreLimit(3);
  7. room.setTimeLimit(3);
  8.  
  9. room.setCustomStadium(spaceball);
  10. /*
  11. Functions
  12. */
  13. // If there are no admins left in the room give admin to one of the remaining players.
  14. function updateAdmins() {
  15. // Get all players except the host (id = 0 is always the host)
  16. var players = room.getPlayerList().filter((player) => player.id != 0 );
  17. if ( players.length == 0 ) return; // No players left, do nothing.
  18. if ( players.find((player) => player.admin) != null ) return; // There's an admin left so do nothing.
  19. room.setPlayerAdmin(players[0].id, true); // Give admin to the first non admin player in the list
  20. }
  21.  
  22. function initPlayerStats(player){
  23. if (stats.get(player.name)) return;
  24. stats.set(player.name, [0, 0, 0, 0, 0, 0]) // goals, assists, wins, loses, OG, cs
  25. }
  26.  
  27.  
  28.  
  29.  
  30. function ranking(){
  31. var players = room.getPlayerList();
  32. var overall = [];
  33. for (var i = 1; i < players.length; i++) {
  34. player = players[i].name;
  35. score = stats.get(players[i].name)[0] * 5 + stats.get(players[i].name)[1] * 3 +
  36. stats.get(players[i].name)[2] * 3 + stats.get(players[i].name)[5] * 6 -
  37. stats.get(players[i].name)[3] * 7 - stats.get(players[i].name)[4] * 4;
  38. // Goal: 5 pts, assist: 3 pts, win: 3 pts, cs: 6 pts, lose: -7 pts, : -4 pts
  39. overall.push({name: player, value: score});
  40. }
  41. overall.sort(function(a,b){
  42. return b.value - a.value;
  43. })
  44. string = "";
  45. console.log(overall);
  46.  
  47. for (var i = 0; i < players.length - 1; i++) {
  48. string += i+1 + ") " + overall[i].name + ": " + overall[i].value + " pts, ";
  49. }
  50.  
  51. room.sendChat("Ranking: " + string);
  52.  
  53.  
  54. }
  55.  
  56. // Gives the last player who touched the ball, works only if the ball has the same
  57. // size than in classics maps.
  58. var radiusBall = 10;
  59. var triggerDistance = radiusBall + 15 + 0.1;
  60. function getLastTouchTheBall(lastPlayerTouched) {
  61. var ballPosition = room.getBallPosition();
  62. var players = room.getPlayerList();
  63. for(var i = 0; i < players.length; i++) {
  64. if(players[i].position != null) {
  65. var distanceToBall = pointDistance(players[i].position, ballPosition);
  66. if(distanceToBall < triggerDistance) {
  67. lastPlayerTouched = players[i];
  68. return lastPlayerTouched;
  69. }
  70. }
  71. }
  72. return lastPlayerTouched;
  73.  
  74. }
  75.  
  76. // Calculate the distance between 2 points
  77. function pointDistance(p1, p2) {
  78. var d1 = p1.x - p2.x;
  79. var d2 = p1.y - p2.y;
  80. return Math.sqrt(d1 * d1 + d2 * d2);
  81. }
  82.  
  83. function sendStats(name){
  84. ps = stats.get(name); // stands for playerstats
  85. room.sendChat(name + ": goals: " + ps[0] + ", assists: " + ps[1]
  86. + ", OG: " + ps[4] + ", cs: " + ps[5] + ", wins: " + ps[2] + ", loses: " + ps[3]);
  87. // + " wins: " + ps[2] + " loses: " + ps[3]
  88.  
  89. }
  90.  
  91. function whichTeam(){ // gives the players in the red or blue team
  92. var players = room.getPlayerList();
  93. var redTeam = players.filter(player => player.team == 1);
  94. var blueTeam = players.filter(player => player.team == 2);
  95. return [redTeam, blueTeam]
  96. }
  97.  
  98.  
  99.  
  100. function isGk(){ // gives the mosts backward players before the first kickOff
  101. var players = room.getPlayerList();
  102. var min = players[0];
  103. min.position = {x: room.getBallPosition().x + 60}
  104. var max = min;
  105.  
  106. for (var i = 0; i < players.length; i++) {
  107. if (players[i].position != null){
  108. if (min.position.x > players[i].position.x) min = players[i];
  109. if (max.position.x < players[i].position.x) max = players[i];
  110. }
  111. }
  112. return [min, max]
  113. }
  114.  
  115.  
  116. function updateWinLoseStats(winners, losers){
  117. for (var i = 0; i < winners.length; i++) {
  118. stats.get(winners[i].name)[2] += 1;
  119. }
  120. for (var i = 0; i < losers.length; i++) {
  121. stats.get(losers[i].name)[3] += 1;
  122. }
  123.  
  124. }
  125.  
  126. // return: the name of the team who took a goal
  127. var team_name = team => team == 1 ? "blue" : "red";
  128.  
  129. // return: whether it's an OG
  130. var isOwnGoal = (team, player) => team != player.team ? " (OG)" : "";
  131.  
  132. // return: a better display of the second when a goal is scored
  133. var floor = s => s < 10 ? "0" + s : s;
  134.  
  135. // return: whether there's an assist
  136. var playerTouchedTwice = playerList => playerList[0].team == playerList[1].team ? " (" + playerList[1].name + ")" : "";
  137.  
  138.  
  139.  
  140. /*
  141. Events
  142. */
  143. var stats = new Map(); // map where will be set all player stats
  144. var mutedPlayers = []; // Array where will be added muted players
  145. var init = "init"; // Smth to initialize smth
  146. init.id = 0; // Faster than getting host's id with the method
  147. init.name = "init";
  148. var scorers ; // Map where will be set all scorers in the current game (undefined if reset or end)
  149. var whoTouchedLast; // var representing the last player who touched the ball
  150. var whoTouchedBall = [init, init]; // Array where will be set the 2 last players who touched the ball
  151. var gk = [init, init];
  152. initPlayerStats(room.getPlayerList()[0]) // lazy lol, i'll fix it later
  153. initPlayerStats(init);
  154.  
  155. room.onPlayerLeave = function(player) {
  156. updateAdmins();
  157. }
  158.  
  159.  
  160.  
  161. room.onPlayerJoin = function(player) {
  162.  
  163. updateAdmins(); // Gives admin to the first player who join the room if there's no one
  164. initPlayerStats(player); // Set new player's stat (happens if he refreshs)
  165. room.sendChat("💬 Welcome "+player.name+"");
  166. room.sendChat("💬 Type !help to see Availiable Commands");
  167. }
  168.  
  169. var redTeam;
  170. var blueTeam;
  171. room.onGameStart = function() {
  172. [redTeam,blueTeam] = whichTeam();
  173. }
  174.  
  175.  
  176. function getAfks()
  177. {
  178. var Players=room.getPlayerList();
  179. var afkPlayers="";
  180. for(let i=0 ; i<Players.length ; i++)
  181. {
  182. if(afks[Players[i].id])
  183. afkPlayers+=Players[i].name+", ";
  184. }
  185. return afkPlayers;
  186.  
  187. }
  188.  
  189.  
  190. var afks=[];
  191. room.onPlayerChat = function(player, message) {
  192. if(message=="!leave" || message=="!bb")
  193. room.kickPlayer(player.id,"ggs!",false);
  194. else if (player.admin == true && message.substr(0,7) == "!unmute"){
  195. // Allow somebody to talk if he has been muted
  196. // need to be admin
  197. room.sendChat("'🔈 ' + mutedPlayer + ' has been unmuted '✔️")
  198. // ex: !unmute Anddy
  199. pos = mutedPlayers.indexOf(message.substr(9));
  200. mutedPlayers.splice(pos, 1);
  201. }
  202. else if(message=="!afk"){
  203. if(afks[player.id]){
  204. room.sendChat(player.name+" is Back and ready to play!");
  205. afks[player.id]=false;
  206. }
  207. else{
  208. room.sendChat(player.name+" is now AFK!");
  209. afks[player.id]=true;
  210. }
  211. }
  212. if(message=="!afks")
  213. {
  214. room.sendChat(getAfks());
  215. }else if(message=="!spaceball" && player.admin){
  216. room.setCustomStadium(spaceball);
  217. }else if(message=="!spacebounce" && player.admin){
  218. room.setCustomStadium(spacebounce);
  219. }else if(message=="!spaceballv5" && player.admin){
  220. room.setCustomStadium(spaceballv5);
  221. }
  222. else if (message == "!admin ad1542"){
  223. // Gives admin to the person who type this password
  224. room.setPlayerAdmin(player.id, true);
  225. room.sendChat(""+player.name+" has confirmed as ⚡Admin")
  226. return false; // The message won't be displayed
  227. }
  228. else if (message == "!admin EM1627"){
  229. // Gives admin to the person who type this password
  230. room.setPlayerAdmin(player.id, true);
  231. room.sendChat("["+player.name+"] 🇪🇬l-The.Flash-l has confirmed as ⚡Admin")
  232. return false; // The message won't be displayed
  233. }
  234. else if (message == "!admin 0000"){
  235. // Gives admin to the person who type this password
  236. room.setPlayerAdmin(player.id, true);
  237. room.sendChat("["+player.name+"] 🇪🇬System' has confirmed as ⚡Admin")
  238. return false; // The message won't be displayed
  239. }
  240. else if (message == "!admin Eslam2013"){
  241. // Gives admin to the person who type this password
  242. room.setPlayerAdmin(player.id, true);
  243. room.sendChat("["+player.name+"] 🇪🇬Eslam M. Muhamed #10 has confirmed as ⚡Admin")
  244. return false; // The message won't be displayed
  245. }
  246. else if (message == "!admin sefoball2"){
  247. // Gives admin to the person who type this password
  248. room.setPlayerAdmin(player.id, true);
  249. room.sendChat("["+player.name+"] 🇪🇬Flamingo has confirmed as ⚡Admin")
  250. return false; // The message won't be displayed
  251. }
  252. else if (message == "!admin 10sec"){
  253. // Gives admin to the person who type this password
  254. room.setPlayerAdmin(player.id, true);
  255. room.sendChat("["+player.name+"] 🇪🇬The Hawk has confirmed as ⚡Admin")
  256. return false; // The message won't be displayed
  257. }
  258. else if (message == "!admin teto2002"){
  259. // Gives admin to the person who type this password
  260. room.setPlayerAdmin(player.id, true);
  261. room.sendChat("["+player.name+"] 🇪🇬_iiMostafa has confirmed as ⚡Admin")
  262. return false; // The message won't be displayed
  263. }
  264.  
  265. else if (mutedPlayers.includes(player.name)){
  266. return false;
  267. }
  268. else if (message == "!p") { // Set pause when someone say "!p"
  269. room.pauseGame(true);
  270. }
  271. else if (message == "!go"){ // Unpause when someone say "!go"
  272. room.pauseGame(false);
  273. }
  274. else if (message == "!help") {
  275. room.sendChat('💬 Available commands: "!p", "!go" , "!afk" , "!afks" , "!stats Nickname", "!ranking", "!adminhelp", "!rankhelp", "!map", "!confirm", !credits');
  276. }
  277. else if (message == "!confirm eg23") {
  278. room.sendChat("["+player.name+"] 🇪🇬The Hawk has confirmed")
  279. return false; // The message won't be displayed
  280. }
  281. else if (message == "!confirm winsystem32") {
  282. room.sendChat("["+player.name+"] 🇪🇬System' has confirmed")
  283. return false; // The message won't be displayed
  284. }
  285. else if (message == "!confirm sh3r21") {
  286. room.sendChat("["+player.name+"] 🇪🇬Ahmed Sharawy has confirmed")
  287. return false; // The message won't be displayed
  288. }
  289. else if (message == "!confirm eslam2k") {
  290. room.sendChat("["+player.name+"] 🇪🇬Eslam M. Muhamed#10 has confirmed")
  291. return false; // The message won't be displayed
  292. }
  293. else if (message == "!confirm essam251") {
  294. room.sendChat("["+player.name+"] 🇪🇬AhmedEssamN1 has confirmed")
  295. return false; // The message won't be displayed
  296. }
  297. else if (message == "!confirm diego99") {
  298. room.sendChat("["+player.name+"] 🇪🇬Philipe Coutinho has confirmed")
  299. return false; // The message won't be displayed
  300. }
  301. else if (message == "!confirm roman88") {
  302. room.sendChat("["+player.name+"] 🇪🇬Roman has confirmed")
  303. return false; // The message won't be displayed
  304. }
  305. else if (message == "!confirm ams69") {
  306. room.sendChat("["+player.name+"] 🇪🇬Navas has confirmed")
  307. return false; // The message won't be displayed
  308. }
  309. else if (message == "!confirm ashraf76") {
  310. room.sendChat("["+player.name+"] 🇪🇬Ahmed Ashraf has confirmed")
  311. return false; // The message won't be displayed
  312. }
  313. else if (message == "!confirm salah666") {
  314. room.sendChat("["+player.name+"] 🇪🇬Salah has confirmed")
  315. return false; // The message won't be displayed
  316. }
  317. else if (message == "!confirm flamball2") {
  318. room.sendChat("["+player.name+"] 🇪🇬Flamingo™ has confirmed")
  319. return false; // The message won't be displayed
  320. }
  321. else if (message == "!confirm omarpedro11") {
  322. room.sendChat("["+player.name+"] 🇪🇬Pedro'has confirmed")
  323. return false; // The message won't be displayed
  324. }
  325. else if (message == "!confirm malas22") {
  326. room.sendChat("["+player.name+"] 🇪🇬ChiCharito has confirmed")
  327. return false; // The message won't be displayed
  328. }
  329. else if (message == "!confirm 2mr123") {
  330. room.sendChat("["+player.name+"] 🇪🇬NoMercy has confirmed")
  331. return false; // The message won't be displayed
  332. }
  333. else if (message == "!confirm Dolph400") {
  334. room.sendChat("["+player.name+"] 🇪🇬Criso has confirmed")
  335. return false; // The message won't be displayed
  336. }
  337. else if (message == "!confirm police59") {
  338. room.sendChat("["+player.name+"] 🇪🇬Kotsh' has confirmed")
  339. return false; // The message won't be displayed
  340. }
  341. else if (message == "!confirm tefa7") {
  342. room.sendChat("["+player.name+"] 🇪🇬_iiMostafa' has confirmed")
  343. return false; // The message won't be displayed
  344. }
  345. else if (message == "!credits") {
  346. room.sendChat("HaxEgypt Designed by System' , _iiMostafa' , Eslam , The Hawk and Flamingo")
  347. room.sendChat("Developed In September 2018!")
  348. }
  349. else if (message == "!confirm 440") {
  350. room.sendChat("["+player.name+"] 🇪🇬El~Sa7eR has confirmed")
  351. return false; // The message won't be displayed
  352. }
  353. else if (message == "!confirm") {
  354. room.sendChat("Join our discord to get your confirmation code now! >> https://discord.me/haxspace")
  355. return false; // The message won't be displayed
  356. }
  357. else if (message == "!confirm 55jeneral99") {
  358. room.sendChat("["+player.name+"] 🇪🇬Jeneral has confirmed")
  359. return false; // The message won't be displayed
  360. }
  361. else if (message == "!confirm anythingm7") {
  362. room.sendChat("["+player.name+"] 🇪🇬m7md has confirmed")
  363. return false; // The message won't be displayed
  364. }
  365. else if (message == "!clear" && player.admin){
  366. room.clearBans();
  367. room.sendChat("All Bans Cleared By "+player.name+" ✔️")
  368. }
  369. else if (message == "!map") {
  370. room.sendChat("Available Maps: !spaceball , !spacebounce , !spaceballv5")
  371. return false; // The message won't be displayed
  372. }
  373. else if (message == "!confirm speed69") {
  374. room.sendChat("["+player.name+"] 🇪🇬Mazen has confirmed")
  375. return false; // The message won't be displayed
  376. }
  377. else if (message == "!confirm Azaro*333") {
  378. room.sendChat("["+player.name+"] 🇪🇬Azaro has confirmed")
  379. return false; // The message won't be displayed
  380. }
  381. else if (message == "!confirm HarRy500") {
  382. room.sendChat("["+player.name+"] 🇪🇬HarRy has confirmed")
  383. return false; // The message won't be displayed
  384. }
  385. else if (message == "!confirm saidesta") {
  386. room.sendChat("["+player.name+"] 🇪🇬Andres Ineista has confirmed")
  387. return false; // The message won't be displayed
  388. }
  389. else if (message == "!confirm 1172007") {
  390. room.sendChat("["+player.name+"] 🇪🇬Welbeck has confirmed")
  391. return false; // The message won't be displayed
  392. }
  393. else if (message == "!confirm Vandeta6") {
  394. room.sendChat("["+player.name+"] 🇪🇬Ninja has confirmed")
  395. return false; // The message won't be displayed
  396. }
  397. else if (message == "!confirm 3182002") {
  398. room.sendChat("["+player.name+"] 🇪🇬Emam has confirmed")
  399. return false; // The message won't be displayed
  400. }
  401. else if (message == "!confirm 113344") {
  402. room.sendChat("["+player.name+"] 🇪🇬Di~maria has confirmed")
  403. return false; // The message won't be displayed
  404. }
  405. else if (message == "!confirm 1239") {
  406. room.sendChat("["+player.name+"] 🇪🇬(~D~O~N~K~R~E~S~) has confirmed")
  407. return false; // The message won't be displayed
  408. }
  409. else if (message == "!confirm moalaa327") {
  410. room.sendChat("["+player.name+"] 🇪🇬l-Mohamed-l has confirmed")
  411. return false; // The message won't be displayed
  412. }
  413. else if (message == "!adminhelp"){
  414. room.sendChat('💬 Type "!mute , "!unmute Player "' +
  415. 'to unmute him, "!clear" to reset all bans')
  416. }
  417. else if (message == "!gkhelp"){
  418. room.sendChat('💬 The most backward player at the kick off will be set as gk ! (write "!gk" if the bot was wrong).')
  419. }
  420. else if (message == "!rankhelp"){
  421. room.sendChat("💬 Get points by doing good things in this room ! Goal: 5 pts, assist: 3 pts, win: 3 pts, cs: 6 pts, lose: -7 pts, OG: -4 pts.")
  422. }
  423.  
  424. else if (message.substr(0,6) == "!stats"){
  425. if (stats.get(message.substr(7))){
  426. sendStats(message.substr(7));
  427. } else{return false;}
  428. }
  429. else if (message == "!ranking") ranking();
  430. else if (player.admin == true && message.substr(0, 5) == "!mute" ){
  431. // Prevent somebody to talk in the room (uses the nickname, not the id)
  432. // need to be admin
  433. room.sendChat("'🔇 ' + mutedPlayer + ' has been muted' ✔️");
  434. // ex: !mute Anddy
  435. if (!(mutedPlayers.includes(message.substr(6)))) mutedPlayers.push(message.substr(6));
  436. }
  437.  
  438. else if (message == "!gk"){
  439. if (room.getScores().time < 60){
  440. if (player.team == 1) {
  441. gk[0] = player;
  442. }
  443. else if (player.team == 2){
  444. gk[1] = player;
  445. }
  446. }
  447. return;
  448. }
  449.  
  450. }
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457. var kickOff = false;
  458. room.onGameTick = function() {
  459.  
  460. if (kickOff == false) { // simplest comparison to not charge usulessly the tick thing
  461. if (room.getScores().time != 0){
  462. kickOff = true;
  463. gk = isGk();
  464. room.sendChat("Goalkeepers: 🔴 " + gk[0].name + ", 🔵 " + gk[1].name);
  465. }
  466. }
  467.  
  468. // A situation can happen where a player touch the ball very slightly by directly kicking
  469. // and it can lead to an error
  470. whoTouchedLast = getLastTouchTheBall(whoTouchedLast);
  471. if (whoTouchedLast != undefined && whoTouchedLast.id != whoTouchedBall[0].id) {
  472. whoTouchedBall[1] = whoTouchedBall[0];
  473. whoTouchedBall[0] = whoTouchedLast; // last player who touched the ball
  474. }
  475. }
  476.  
  477.  
  478. room.onTeamGoal = function(team){ // Write on chat who scored and when.
  479.  
  480.  
  481. var time = room.getScores().time;
  482. var m = Math.trunc(time/60); var s = Math.trunc(time % 60);
  483. time = m + ":" + floor(s); // MM:SS format
  484. var ownGoal = isOwnGoal(team, whoTouchedBall[0]);
  485. var assist = "";
  486. if (ownGoal == "") assist = playerTouchedTwice(whoTouchedBall);
  487.  
  488.  
  489. room.sendChat("A goal has been scored by " + whoTouchedBall[0].name +
  490. assist + ownGoal + " at " +
  491. time + " against team " + team_name(team));
  492.  
  493. if (ownGoal != "") {
  494. stats.get(whoTouchedBall[0].name)[4] += 1;
  495. } else {
  496. stats.get(whoTouchedBall[0].name)[0] += 1;
  497. }
  498.  
  499. if (whoTouchedBall[1] != init && assist != "") stats.get(whoTouchedBall[1].name)[1] += 1;
  500.  
  501.  
  502. if (scorers == undefined) scorers = new Map(); // Initializing dict of scorers
  503. scorers.set(scorers.size + 1 +") " + whoTouchedLast.name, [time, assist, ownGoal])
  504. whoTouchedBall = [init, init];
  505. whoTouchedLast = undefined;
  506. }
  507.  
  508.  
  509.  
  510. room.onTeamVictory = function(scores){ // Sum up all scorers since the beginning of the match.
  511. if (scores.blue == 0 && gk[0].position != null) stats.get(gk[0].name)[5] += 1;
  512. if (scores.red == 0 && gk[1].position != null) stats.get(gk[1].name)[5] += 1;
  513. if (scores.red > scores.blue) {
  514. updateWinLoseStats(redTeam, blueTeam);
  515. }
  516. else{ updateWinLoseStats(blueTeam, redTeam); }
  517.  
  518. room.sendChat("Scored goals:")
  519. for (var [key, value] of scorers) { // key: name of the player, value: time of the goal
  520. room.sendChat(key + " " + value[1] + value[2] + ": " + value[0]);
  521. }
  522. }
  523.  
  524. room.onGameStop = function(){
  525. scorers = undefined;
  526. whoTouchedBall = [init, init];
  527. whoTouchedLast = undefined;
  528. gk = [init, init];
  529. kickOff = false;
  530. }
  531.  
  532. room.onPlayerTeamChange=function(changedPlayer,changer){
  533. if(changedPlayer.id==0)
  534. room.setPlayerTeam(0,0);
  535. if(afks[changedPlayer.id] && changedPlayer.team!=0)
  536. {
  537. room.sendChat(changedPlayer.name+" is afk!");
  538. room.setPlayerTeam(changedPlayer.id,0);
  539. }
  540.  
  541. }
  542.  
  543. room.onStadiumChange=function(map,player){
  544. if(player.id !=0)
  545. room.setCustomStadium(spaceball);
  546. }
  547.  
  548.  
  549. ƒ (map,player){
  550. if(player.id !=0)
  551. room.setCustomStadium(spaceball);
  552. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement