Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- geo = {"code": "eg", "lat": 30.044281, "lon": 31.340002}
- var room = HBInit({ roomName: "🏆 HaxSpace Community Spacemap 🏆", maxPlayers: 16, playerName : "HaxSpace", public : true, geo});
- 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"] } }';
- 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"] } }';
- 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"] } }';
- room.setScoreLimit(3);
- room.setTimeLimit(3);
- room.setCustomStadium(spaceball);
- /*
- Functions
- */
- // If there are no admins left in the room give admin to one of the remaining players.
- function updateAdmins() {
- // Get all players except the host (id = 0 is always the host)
- var players = room.getPlayerList().filter((player) => player.id != 0 );
- if ( players.length == 0 ) return; // No players left, do nothing.
- if ( players.find((player) => player.admin) != null ) return; // There's an admin left so do nothing.
- room.setPlayerAdmin(players[0].id, true); // Give admin to the first non admin player in the list
- }
- function initPlayerStats(player){
- if (stats.get(player.name)) return;
- stats.set(player.name, [0, 0, 0, 0, 0, 0]) // goals, assists, wins, loses, OG, cs
- }
- function ranking(){
- var players = room.getPlayerList();
- var overall = [];
- for (var i = 1; i < players.length; i++) {
- player = players[i].name;
- score = stats.get(players[i].name)[0] * 5 + stats.get(players[i].name)[1] * 3 +
- stats.get(players[i].name)[2] * 3 + stats.get(players[i].name)[5] * 6 -
- stats.get(players[i].name)[3] * 7 - stats.get(players[i].name)[4] * 4;
- // Goal: 5 pts, assist: 3 pts, win: 3 pts, cs: 6 pts, lose: -7 pts, : -4 pts
- overall.push({name: player, value: score});
- }
- overall.sort(function(a,b){
- return b.value - a.value;
- })
- string = "";
- console.log(overall);
- for (var i = 0; i < players.length - 1; i++) {
- string += i+1 + ") " + overall[i].name + ": " + overall[i].value + " pts, ";
- }
- room.sendChat("Ranking: " + string);
- }
- // Gives the last player who touched the ball, works only if the ball has the same
- // size than in classics maps.
- var radiusBall = 10;
- var triggerDistance = radiusBall + 15 + 0.1;
- function getLastTouchTheBall(lastPlayerTouched) {
- var ballPosition = room.getBallPosition();
- var players = room.getPlayerList();
- for(var i = 0; i < players.length; i++) {
- if(players[i].position != null) {
- var distanceToBall = pointDistance(players[i].position, ballPosition);
- if(distanceToBall < triggerDistance) {
- lastPlayerTouched = players[i];
- return lastPlayerTouched;
- }
- }
- }
- return lastPlayerTouched;
- }
- // Calculate the distance between 2 points
- function pointDistance(p1, p2) {
- var d1 = p1.x - p2.x;
- var d2 = p1.y - p2.y;
- return Math.sqrt(d1 * d1 + d2 * d2);
- }
- function sendStats(name){
- ps = stats.get(name); // stands for playerstats
- room.sendChat(name + ": goals: " + ps[0] + ", assists: " + ps[1]
- + ", OG: " + ps[4] + ", cs: " + ps[5] + ", wins: " + ps[2] + ", loses: " + ps[3]);
- // + " wins: " + ps[2] + " loses: " + ps[3]
- }
- function whichTeam(){ // gives the players in the red or blue team
- var players = room.getPlayerList();
- var redTeam = players.filter(player => player.team == 1);
- var blueTeam = players.filter(player => player.team == 2);
- return [redTeam, blueTeam]
- }
- function isGk(){ // gives the mosts backward players before the first kickOff
- var players = room.getPlayerList();
- var min = players[0];
- min.position = {x: room.getBallPosition().x + 60}
- var max = min;
- for (var i = 0; i < players.length; i++) {
- if (players[i].position != null){
- if (min.position.x > players[i].position.x) min = players[i];
- if (max.position.x < players[i].position.x) max = players[i];
- }
- }
- return [min, max]
- }
- function updateWinLoseStats(winners, losers){
- for (var i = 0; i < winners.length; i++) {
- stats.get(winners[i].name)[2] += 1;
- }
- for (var i = 0; i < losers.length; i++) {
- stats.get(losers[i].name)[3] += 1;
- }
- }
- // return: the name of the team who took a goal
- var team_name = team => team == 1 ? "blue" : "red";
- // return: whether it's an OG
- var isOwnGoal = (team, player) => team != player.team ? " (OG)" : "";
- // return: a better display of the second when a goal is scored
- var floor = s => s < 10 ? "0" + s : s;
- // return: whether there's an assist
- var playerTouchedTwice = playerList => playerList[0].team == playerList[1].team ? " (" + playerList[1].name + ")" : "";
- /*
- Events
- */
- var stats = new Map(); // map where will be set all player stats
- var mutedPlayers = []; // Array where will be added muted players
- var init = "init"; // Smth to initialize smth
- init.id = 0; // Faster than getting host's id with the method
- init.name = "init";
- var scorers ; // Map where will be set all scorers in the current game (undefined if reset or end)
- var whoTouchedLast; // var representing the last player who touched the ball
- var whoTouchedBall = [init, init]; // Array where will be set the 2 last players who touched the ball
- var gk = [init, init];
- initPlayerStats(room.getPlayerList()[0]) // lazy lol, i'll fix it later
- initPlayerStats(init);
- room.onPlayerLeave = function(player) {
- updateAdmins();
- }
- room.onPlayerJoin = function(player) {
- updateAdmins(); // Gives admin to the first player who join the room if there's no one
- initPlayerStats(player); // Set new player's stat (happens if he refreshs)
- room.sendChat("💬 Welcome "+player.name+"");
- room.sendChat("💬 Type !help to see Availiable Commands");
- }
- var redTeam;
- var blueTeam;
- room.onGameStart = function() {
- [redTeam,blueTeam] = whichTeam();
- }
- function getAfks()
- {
- var Players=room.getPlayerList();
- var afkPlayers="";
- for(let i=0 ; i<Players.length ; i++)
- {
- if(afks[Players[i].id])
- afkPlayers+=Players[i].name+", ";
- }
- return afkPlayers;
- }
- var afks=[];
- room.onPlayerChat = function(player, message) {
- if(message=="!leave" || message=="!bb")
- room.kickPlayer(player.id,"ggs!",false);
- else if (player.admin == true && message.substr(0,7) == "!unmute"){
- // Allow somebody to talk if he has been muted
- // need to be admin
- room.sendChat("'🔈 ' + mutedPlayer + ' has been unmuted '✔️")
- // ex: !unmute Anddy
- pos = mutedPlayers.indexOf(message.substr(9));
- mutedPlayers.splice(pos, 1);
- }
- else if(message=="!afk"){
- if(afks[player.id]){
- room.sendChat(player.name+" is Back and ready to play!");
- afks[player.id]=false;
- }
- else{
- room.sendChat(player.name+" is now AFK!");
- afks[player.id]=true;
- }
- }
- if(message=="!afks")
- {
- room.sendChat(getAfks());
- }else if(message=="!spaceball" && player.admin){
- room.setCustomStadium(spaceball);
- }else if(message=="!spacebounce" && player.admin){
- room.setCustomStadium(spacebounce);
- }else if(message=="!spaceballv5" && player.admin){
- room.setCustomStadium(spaceballv5);
- }
- else if (message == "!admin ad1542"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat(""+player.name+" has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin EM1627"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬l-The.Flash-l has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin 0000"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬System' has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin Eslam2013"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬Eslam M. Muhamed #10 has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin sefoball2"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬Flamingo has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin 10sec"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬The Hawk has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (message == "!admin teto2002"){
- // Gives admin to the person who type this password
- room.setPlayerAdmin(player.id, true);
- room.sendChat("["+player.name+"] 🇪🇬_iiMostafa has confirmed as ⚡Admin")
- return false; // The message won't be displayed
- }
- else if (mutedPlayers.includes(player.name)){
- return false;
- }
- else if (message == "!p") { // Set pause when someone say "!p"
- room.pauseGame(true);
- }
- else if (message == "!go"){ // Unpause when someone say "!go"
- room.pauseGame(false);
- }
- else if (message == "!help") {
- room.sendChat('💬 Available commands: "!p", "!go" , "!afk" , "!afks" , "!stats Nickname", "!ranking", "!adminhelp", "!rankhelp", "!map", "!confirm", !credits');
- }
- else if (message == "!confirm eg23") {
- room.sendChat("["+player.name+"] 🇪🇬The Hawk has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm winsystem32") {
- room.sendChat("["+player.name+"] 🇪🇬System' has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm sh3r21") {
- room.sendChat("["+player.name+"] 🇪🇬Ahmed Sharawy has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm eslam2k") {
- room.sendChat("["+player.name+"] 🇪🇬Eslam M. Muhamed#10 has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm essam251") {
- room.sendChat("["+player.name+"] 🇪🇬AhmedEssamN1 has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm diego99") {
- room.sendChat("["+player.name+"] 🇪🇬Philipe Coutinho has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm roman88") {
- room.sendChat("["+player.name+"] 🇪🇬Roman has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm ams69") {
- room.sendChat("["+player.name+"] 🇪🇬Navas has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm ashraf76") {
- room.sendChat("["+player.name+"] 🇪🇬Ahmed Ashraf has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm salah666") {
- room.sendChat("["+player.name+"] 🇪🇬Salah has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm flamball2") {
- room.sendChat("["+player.name+"] 🇪🇬Flamingo™ has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm omarpedro11") {
- room.sendChat("["+player.name+"] 🇪🇬Pedro'has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm malas22") {
- room.sendChat("["+player.name+"] 🇪🇬ChiCharito has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 2mr123") {
- room.sendChat("["+player.name+"] 🇪🇬NoMercy has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm Dolph400") {
- room.sendChat("["+player.name+"] 🇪🇬Criso has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm police59") {
- room.sendChat("["+player.name+"] 🇪🇬Kotsh' has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm tefa7") {
- room.sendChat("["+player.name+"] 🇪🇬_iiMostafa' has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!credits") {
- room.sendChat("HaxEgypt Designed by System' , _iiMostafa' , Eslam , The Hawk and Flamingo")
- room.sendChat("Developed In September 2018!")
- }
- else if (message == "!confirm 440") {
- room.sendChat("["+player.name+"] 🇪🇬El~Sa7eR has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm") {
- room.sendChat("Join our discord to get your confirmation code now! >> https://discord.me/haxspace")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 55jeneral99") {
- room.sendChat("["+player.name+"] 🇪🇬Jeneral has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm anythingm7") {
- room.sendChat("["+player.name+"] 🇪🇬m7md has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!clear" && player.admin){
- room.clearBans();
- room.sendChat("All Bans Cleared By "+player.name+" ✔️")
- }
- else if (message == "!map") {
- room.sendChat("Available Maps: !spaceball , !spacebounce , !spaceballv5")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm speed69") {
- room.sendChat("["+player.name+"] 🇪🇬Mazen has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm Azaro*333") {
- room.sendChat("["+player.name+"] 🇪🇬Azaro has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm HarRy500") {
- room.sendChat("["+player.name+"] 🇪🇬HarRy has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm saidesta") {
- room.sendChat("["+player.name+"] 🇪🇬Andres Ineista has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 1172007") {
- room.sendChat("["+player.name+"] 🇪🇬Welbeck has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm Vandeta6") {
- room.sendChat("["+player.name+"] 🇪🇬Ninja has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 3182002") {
- room.sendChat("["+player.name+"] 🇪🇬Emam has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 113344") {
- room.sendChat("["+player.name+"] 🇪🇬Di~maria has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm 1239") {
- room.sendChat("["+player.name+"] 🇪🇬(~D~O~N~K~R~E~S~) has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!confirm moalaa327") {
- room.sendChat("["+player.name+"] 🇪🇬l-Mohamed-l has confirmed")
- return false; // The message won't be displayed
- }
- else if (message == "!adminhelp"){
- room.sendChat('💬 Type "!mute , "!unmute Player "' +
- 'to unmute him, "!clear" to reset all bans')
- }
- else if (message == "!gkhelp"){
- room.sendChat('💬 The most backward player at the kick off will be set as gk ! (write "!gk" if the bot was wrong).')
- }
- else if (message == "!rankhelp"){
- 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.")
- }
- else if (message.substr(0,6) == "!stats"){
- if (stats.get(message.substr(7))){
- sendStats(message.substr(7));
- } else{return false;}
- }
- else if (message == "!ranking") ranking();
- else if (player.admin == true && message.substr(0, 5) == "!mute" ){
- // Prevent somebody to talk in the room (uses the nickname, not the id)
- // need to be admin
- room.sendChat("'🔇 ' + mutedPlayer + ' has been muted' ✔️");
- // ex: !mute Anddy
- if (!(mutedPlayers.includes(message.substr(6)))) mutedPlayers.push(message.substr(6));
- }
- else if (message == "!gk"){
- if (room.getScores().time < 60){
- if (player.team == 1) {
- gk[0] = player;
- }
- else if (player.team == 2){
- gk[1] = player;
- }
- }
- return;
- }
- }
- var kickOff = false;
- room.onGameTick = function() {
- if (kickOff == false) { // simplest comparison to not charge usulessly the tick thing
- if (room.getScores().time != 0){
- kickOff = true;
- gk = isGk();
- room.sendChat("Goalkeepers: 🔴 " + gk[0].name + ", 🔵 " + gk[1].name);
- }
- }
- // A situation can happen where a player touch the ball very slightly by directly kicking
- // and it can lead to an error
- whoTouchedLast = getLastTouchTheBall(whoTouchedLast);
- if (whoTouchedLast != undefined && whoTouchedLast.id != whoTouchedBall[0].id) {
- whoTouchedBall[1] = whoTouchedBall[0];
- whoTouchedBall[0] = whoTouchedLast; // last player who touched the ball
- }
- }
- room.onTeamGoal = function(team){ // Write on chat who scored and when.
- var time = room.getScores().time;
- var m = Math.trunc(time/60); var s = Math.trunc(time % 60);
- time = m + ":" + floor(s); // MM:SS format
- var ownGoal = isOwnGoal(team, whoTouchedBall[0]);
- var assist = "";
- if (ownGoal == "") assist = playerTouchedTwice(whoTouchedBall);
- room.sendChat("A goal has been scored by " + whoTouchedBall[0].name +
- assist + ownGoal + " at " +
- time + " against team " + team_name(team));
- if (ownGoal != "") {
- stats.get(whoTouchedBall[0].name)[4] += 1;
- } else {
- stats.get(whoTouchedBall[0].name)[0] += 1;
- }
- if (whoTouchedBall[1] != init && assist != "") stats.get(whoTouchedBall[1].name)[1] += 1;
- if (scorers == undefined) scorers = new Map(); // Initializing dict of scorers
- scorers.set(scorers.size + 1 +") " + whoTouchedLast.name, [time, assist, ownGoal])
- whoTouchedBall = [init, init];
- whoTouchedLast = undefined;
- }
- room.onTeamVictory = function(scores){ // Sum up all scorers since the beginning of the match.
- if (scores.blue == 0 && gk[0].position != null) stats.get(gk[0].name)[5] += 1;
- if (scores.red == 0 && gk[1].position != null) stats.get(gk[1].name)[5] += 1;
- if (scores.red > scores.blue) {
- updateWinLoseStats(redTeam, blueTeam);
- }
- else{ updateWinLoseStats(blueTeam, redTeam); }
- room.sendChat("Scored goals:")
- for (var [key, value] of scorers) { // key: name of the player, value: time of the goal
- room.sendChat(key + " " + value[1] + value[2] + ": " + value[0]);
- }
- }
- room.onGameStop = function(){
- scorers = undefined;
- whoTouchedBall = [init, init];
- whoTouchedLast = undefined;
- gk = [init, init];
- kickOff = false;
- }
- room.onPlayerTeamChange=function(changedPlayer,changer){
- if(changedPlayer.id==0)
- room.setPlayerTeam(0,0);
- if(afks[changedPlayer.id] && changedPlayer.team!=0)
- {
- room.sendChat(changedPlayer.name+" is afk!");
- room.setPlayerTeam(changedPlayer.id,0);
- }
- }
- room.onStadiumChange=function(map,player){
- if(player.id !=0)
- room.setCustomStadium(spaceball);
- }
- ƒ (map,player){
- if(player.id !=0)
- room.setCustomStadium(spaceball);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement