GrandTabernacleAutoVI/public_html/js/global.js
2023-12-26 20:03:05 +01:00

161 lines
21 KiB
JavaScript

let player = null;
let players = [];
let renderer = new Render("canvas");
let LB = new LeaderBoard("canvas");
let bulletSound = new Sound("./assets/sounds/shoot.mp3");
let driftSound = new Sound("./assets/sounds/drift.mp3");
let notificationSound = new Sound("./assets/sounds/notification.mp3");
let net = new Network("wss://ws.gta6.insat.fr:8080?name=" + getCookie("pseudo"));
let inp = new Input("canvas");
let phone = new Phone();
let bullets = [];
let circles = [];
let squares = [];
let PNJS = [new PNJ(500, 100,0),
new PNJ(700, 100,0),
new PNJ(500, 600,0),
new PNJ(200, 700,0)];
let cars = [new Car(1, 7),
//new Car(1, 12),
//new Car(1, 20),
new Car(1, 34),
//new Car(1, 58),
new Car(0, 20),
//new Car(0, 7),
//new Car(0, 18),
//new Car(0, 26),
//new Car(0, 45),
new Car(0, 52)];
let portals = [new Portal(250,457,0,516,789,1),//O
new Portal(344,758,0,50,852,4), // SO
new Portal(1190,211,0,871,856,9),// NE
new Portal(862,213,0,200,147,5), // N
new Portal(1126,472,0,583,810,3),// E
new Portal(1076,768,0,484,898,2),// SE
new Portal(721,767,0,917,547,7), // S -> grotte chelou
new Portal(970,476,0,1056,449,8),//Mid -> Poudlar
new Portal(617,154,1,274,244,0),//out map 1
new Portal(95,561,2,989,694,0), //out map 2
new Portal(569,828,3,1152,519,0),//out map 3
new Portal(105, 852,4,365,800,0), //out map 4
new Portal(110,122,5,880,255,0), //out map 5
new Portal(231,475,5,131,313,6), //pour aller a l'étage (map6)
new Portal(115,353,6,317,493,5), //out map6 (pour aller a map5)
new Portal(948,517,7,740,815,0), //out map7
new Portal(1075,421,8,985,520,0), //out map8
new Portal(209,731,8,235,182,8), //troll map8
new Portal(209,110,8,235,730,8), //troll map8
new Portal(500,340,9,1089,227,0) //out map 9 (vers suite du donjon)
];
let map0Squares = [new Square(1064,371,0,126,125),new Square(1160,113,0,143,126),new Square(1017,113,0,146,80),new Square(1018,192,0,10,47),new Square(1028,227,0,45,12),new Square(1101,227,0,66,12),new Square(791,113,0,176,126),new Square(522,129,0,103,13),new Square(654,128,0,104,15),new Square(747,144,0,12,34),new Square(748,194,0,10,44),new Square(655,224,0,101,15),new Square(520,227,0,106,13),new Square(522,195,0,11,39),new Square(522,131,0,8,46),new Square(588,154,0,10,22),new Square(651,153,0,10,21),new Square(698,188,0,12,19),new Square(697,373,0,318,124),new Square(697,497,0,158,112),new Square(1001,629,0,188,155),new Square(696,626,0,159,158),new Square(281,627,0,173,156),new Square(168,243,0,61,250),new Square(229,259,0,87,218),new Square(311,242,0,62,254),new Square(296,112,0,79,95),new Square(2,0,0,1350,14),new Square(1337,2,0,130,927),new Square(119,909,0,1250,17),new Square(4,1,0,129,923),new Square(543,156,0,16,18),new Square(559,207,0,16,17),new Square(598,179,0,17,29),new Square(721,157,0,13,17),new Square(673,205,0,14,17)];
let map1Squares = [new Square(1,0,1,1020,160),new Square(868,48,1,153,969),new Square(2,838,1,1019,182),new Square(1,0,1,148,998)];
let map2Squares = [new Square(25,936,2,989,83),new Square(1,1,2,98,974),new Square(5,8,2,1002,250),new Square(941,10,2,80,1002),new Square(816,617,2,146,168),new Square(764,252,2,48,214),new Square(805,282,2,154,92),new Square(406,233,2,195,166),new Square(94,418,2,155,88),new Square(94,277,2,127,68),new Square(198,762,2,60,103),new Square(225,880,2,53,30),new Square(116,854,2,35,32)];
let map3Squares = [new Square(19,836,3,857,48),new Square(706,324,3,180,531),new Square(640,321,3,75,168),new Square(832,10,3,60,325),new Square(3,2,3,843,165),new Square(354,48,3,90,302),new Square(256,321,3,287,165),new Square(1,1,3,62,374),new Square(51,320,3,109,157),new Square(4,434,3,90,436),new Square(146,680,3,124,71),new Square(92,754,3,32,88),new Square(290,554,3,220,36),new Square(708,150,3,87,68),new Square(323,206,3,39,59),new Square(50,127,3,72,93),new Square(448,648,3,61,44),new Square(578,645,3,92,45),new Square(802,236,3,36,60)];
let map4Squares = [new Square(101,64,4,47,45),new Square(281,46,4,42,39),new Square(343,58,4,47,41),new Square(334,237,4,37,38),new Square(383,209,4,39,39),new Square(516,53,4,91,91),new Square(531,139,4,65,11),new Square(605,68,4,11,59),new Square(510,70,4,8,60),new Square(531,45,4,66,16),new Square(700,48,4,85,39),new Square(854,159,4,50,67),new Square(528,377,4,45,26),new Square(944,109,4,25,273),new Square(1106,137,4,47,122),new Square(1107,302,4,46,125),new Square(611,674,4,46,122),new Square(617,810,4,128,48),new Square(847,52,4,11,39),new Square(857,35,4,64,74),new Square(919,34,4,23,409),new Square(921,432,4,100,16),new Square(1102,432,4,89,16),new Square(661,39,4,19,252),new Square(665,278,4,97,19),new Square(839,279,4,84,15),new Square(28,279,4,93,19),new Square(198,279,4,246,19),new Square(429,32,4,18,266),new Square(1,1,4,39,904),new Square(32,1,4,6,0),new Square(35,0,4,1181,36),new Square(1184,22,4,32,882),new Square(0,872,4,1,0),new Square(0,870,4,1215,35),new Square(481,354,4,119,16),new Square(177,650,4,98,15),new Square(175,650,4,20,223),new Square(356,647,4,246,15),new Square(584,647,4,22,223),new Square(478,640,4,123,7),new Square(681,443,4,15,126),new Square(502,546,4,84,46),new Square(525,596,4,46,46),new Square(403,432,4,18,19),new Square(412,418,4,20,21),new Square(426,401,4,24,23),new Square(442,386,4,21,21),new Square(456,367,4,28,25),new Square(593,359,4,0,0),new Square(593,359,4,19,16),new Square(603,366,4,22,20),new Square(616,381,4,23,17),new Square(626,386,4,25,23),new Square(641,401,4,25,23),new Square(659,418,4,22,16),new Square(675,427,4,12,19),new Square(601,634,4,18,15),new Square(611,618,4,21,21),new Square(627,600,4,22,22),new Square(643,591,4,18,14),new Square(655,571,4,23,24),new Square(671,561,4,15,19),new Square(401,563,4,17,16),new Square(411,572,4,19,23),new Square(422,586,4,19,17),new Square(437,598,4,22,17),new Square(448,610,4,17,16),new Square(463,622,4,15,16),new Square(470,629,4,16,14)]
let map5Squares = [new Square(520,51,5,84,114),new Square(639,52,5,80,115),new Square(750,51,5,81,116),new Square(641,395,5,79,116),new Square(752,396,5,86,126),new Square(846,7,5,49,547),new Square(10,3,5,840,53),new Square(221,44,5,228,60),new Square(10,0,5,101,356),new Square(502,221,5,35,200),new Square(386,396,5,151,29),new Square(102,213,5,214,15),new Square(9,349,5,343,100),new Square(11,447,5,74,108),new Square(206,506,5,688,51),new Square(13,520,5,193,35),new Square(76,432,5,223,44)]
let map6Squares = [new Square(8,27,6,103,510),new Square(99,509,6,789,27),new Square(851,30,6,47,501),new Square(100,28,6,755,24),new Square(103,255,6,29,53),new Square(561,253,6,174,58),new Square(744,269,6,25,26),new Square(697,224,6,22,23),new Square(694,315,6,22,26),new Square(641,314,6,25,29),new Square(638,224,6,30,24),new Square(579,223,6,27,24),new Square(106,177,6,53,45),new Square(97,42,6,50,42),new Square(130,79,6,32,25),new Square(167,46,6,67,36),new Square(201,68,6,34,26),new Square(381,66,6,34,21),new Square(509,46,6,55,49),new Square(524,88,6,34,31),new Square(555,46,6,49,28),new Square(787,63,6,30,27),new Square(813,43,6,40,65),new Square(601,461,6,91,44),new Square(583,482,6,131,27),new Square(155,481,6,182,31),new Square(157,341,6,21,146),new Square(232,208,6,28,79),new Square(232,207,6,103,13),new Square(347,349,6,69,24)]
let map7Squares = [new Square(865,306,7,5,356),new Square(289,60,7,667,32),new Square(934,59,7,27,445),new Square(292,635,7,579,31),new Square(867,653,7,89,13),new Square(933,579,7,24,85),new Square(934,577,7,79,16),new Square(936,490,7,76,13),new Square(58,296,7,149,54),new Square(44,377,7,165,50),new Square(175,654,7,118,14),new Square(178,56,7,113,17),new Square(289,84,7,4,136),new Square(287,506,7,8,148),new Square(289,214,7,49,7),new Square(288,505,7,48,6),new Square(427,90,7,92,50),new Square(566,90,7,94,54),new Square(711,89,7,93,53),new Square(715,585,7,90,49),new Square(572,585,7,93,52),new Square(427,585,7,93,53),new Square(31,248,7,51,250),new Square(1001,497,7,10,93)]
let map8Squares = [new Square(180,739,8,245,12),new Square(328,508,8,9,232),new Square(325,126,8,11,238),new Square(1118,176,8,17,588),new Square(1099,117,8,45,62),new Square(1000,115,8,101,24),new Square(995,106,8,27,41),new Square(1060,113,8,28,35),new Square(989,91,8,12,32),new Square(1002,85,8,0,0),new Square(1002,85,8,0,0),new Square(1002,85,8,0,0),new Square(756,75,8,268,25),new Square(661,71,8,92,77),new Square(405,68,8,260,32),new Square(395,72,8,37,52),new Square(400,111,8,26,35),new Square(325,106,8,77,29),new Square(328,109,8,29,37),new Square(180,108,8,167,26),new Square(1123,727,8,5,37),new Square(1101,694,8,43,80),new Square(1058,725,8,31,33),new Square(1082,735,8,41,16),new Square(995,727,8,29,44),new Square(1000,736,8,62,27),new Square(986,750,8,26,31),new Square(762,771,8,276,30),new Square(664,725,8,23,28),new Square(680,735,8,64,19),new Square(734,726,8,19,77),new Square(424,769,8,260,27),new Square(401,726,8,24,31),new Square(407,750,8,22,39),new Square(335,728,8,21,11),new Square(371,573,8,286,28),new Square(755,574,8,289,28),new Square(756,655,8,288,28),new Square(373,656,8,284,25),new Square(373,187,8,283,29),new Square(757,187,8,287,28),new Square(756,269,8,288,29),new Square(372,269,8,287,28),new Square(388,179,8,254,46),new Square(770,176,8,261,51),new Square(773,260,8,257,48),new Square(388,259,8,256,50),new Square(386,565,8,258,47),new Square(387,641,8,255,49),new Square(660,745,8,20,46),new Square(772,561,8,253,49),new Square(774,643,8,255,50),new Square(272,158,8,28,169),new Square(270,541,8,29,173),new Square(244,675,8,31,17),new Square(243,617,8,33,18),new Square(246,559,8,30,20),new Square(246,174,8,33,21),new Square(244,231,8,32,21),new Square(244,281,8,32,25),new Square(145,694,8,35,75),new Square(144,91,8,37,84),new Square(132,169,8,25,561),new Square(153,323,8,14,221)]
let map9Squares = [new Square(1,2,9,15,429),new Square(55,179,9,16,303),new Square(2,469,9,67,14),new Square(13,424,9,46,5),new Square(55,110,9,15,31),new Square(71,69,9,0,0),new Square(57,1,9,14,68),new Square(15,0,9,883,14),new Square(885,1,9,15,823),new Square(863,810,9,36,15),new Square(808,755,9,21,70),new Square(629,755,9,268,17),new Square(702,702,9,16,57),new Square(704,810,9,71,16),new Square(704,816,9,12,71),new Square(709,864,9,190,32),new Square(1,880,9,711,16),new Square(164,829,9,31,53),new Square(182,809,9,15,72),new Square(628,756,9,37,87),new Square(0,471,9,16,418),new Square(468,7,9,16,61),new Square(468,53,9,68,16),new Square(522,52,9,16,189),new Square(449,234,9,0,0),new Square(450,232,9,216,19),new Square(577,158,9,15,75),new Square(576,53,9,15,72),new Square(577,52,9,195,17),new Square(813,10,9,13,105),new Square(813,74,9,32,51),new Square(108,52,9,324,18),new Square(415,61,9,15,53),new Square(397,107,9,87,17),new Square(468,107,9,17,63),new Square(450,163,9,34,15),new Square(397,161,9,15,132),new Square(402,178,9,65,18),new Square(162,108,9,195,16),new Square(343,116,9,16,133),new Square(108,56,9,15,192),new Square(110,234,9,87,16),new Square(165,181,9,14,53),new Square(164,180,9,106,16),new Square(254,160,9,16,36),new Square(181,162,9,33,19),new Square(52,521,9,199,17),new Square(217,504,9,34,34),new Square(216,360,9,17,160),new Square(232,341,9,18,87),new Square(578,111,9,85,14),new Square(703,109,9,14,31),new Square(703,109,9,68,13),new Square(755,63,9,18,131),new Square(756,177,9,63,18),new Square(812,160,9,34,33),new Square(810,186,9,15,51),new Square(758,234,9,85,16),new Square(758,244,9,14,175),new Square(630,118,9,14,77),new Square(631,181,9,89,13),new Square(639,163,9,25,22),new Square(702,191,9,15,110),new Square(340,289,9,377,12),new Square(576,298,9,14,122),new Square(632,343,9,31,30),new Square(661,342,9,56,14),new Square(703,342,9,14,34),new Square(703,412,9,139,17),new Square(812,394,9,31,31),new Square(829,396,9,13,320),new Square(758,702,9,83,15),new Square(757,632,9,13,75),new Square(757,577,9,75,13),new Square(810,584,9,25,61),new Square(648,648,9,112,14),new Square(648,648,9,15,67),new Square(525,703,9,139,14),new Square(632,666,9,21,40),new Square(704,520,9,12,130),new Square(705,520,9,86,17),new Square(654,468,9,118,15),new Square(648,369,9,15,167),new Square(812,289,9,12,61),new Square(811,342,9,36,16),new Square(813,287,9,76,15),new Square(52,521,9,19,53),new Square(111,579,9,13,83),new Square(111,576,9,83,14),new Square(182,585,9,11,24),new Square(118,587,9,22,20),new Square(54,648,9,69,15),new Square(53,647,9,17,120),new Square(10,757,9,60,15),new Square(110,288,9,14,233),new Square(162,294,9,17,189),new Square(112,287,9,135,16),new Square(236,235,9,13,64),new Square(237,233,9,121,16),new Square(290,244,9,14,119),new Square(290,357,9,119,22),new Square(345,342,9,64,33),new Square(397,342,9,14,130),new Square(451,413,9,200,15),new Square(290,415,9,15,110),new Square(290,414,9,69,16),new Square(290,523,9,242,15),new Square(344,468,9,266,16),new Square(524,482,9,14,114),new Square(524,595,9,67,15),new Square(577,595,9,14,68),new Square(526,651,9,12,66),new Square(472,651,9,66,12),new Square(472,577,9,11,86),new Square(416,577,9,67,33),new Square(414,577,9,14,139),new Square(416,704,9,68,14),new Square(470,704,9,14,85),new Square(524,756,9,15,77),new Square(577,711,9,16,131),new Square(234,826,9,358,20),new Square(235,811,9,86,18),new Square(234,721,9,18,118),new Square(289,758,9,14,55),new Square(294,758,9,31,13),new Square(109,755,9,131,17),new Square(219,702,9,15,54),new Square(107,700,9,71,17),new Square(162,648,9,14,55),new Square(162,649,9,90,15),new Square(236,579,9,16,85),new Square(290,578,9,15,31),new Square(245,594,9,60,15),new Square(126,716,9,17,39),new Square(107,757,9,18,89),new Square(55,830,9,70,16),new Square(74,809,9,40,25),new Square(291,650,9,14,66),new Square(290,702,9,63,16),new Square(363,773,9,68,16),new Square(414,757,9,16,16),new Square(362,668,9,14,120),new Square(343,535,9,21,182),new Square(359,533,9,18,78),new Square(579,522,9,13,31),new Square(588,522,9,74,14),new Square(631,533,9,15,74),new Square(632,576,9,34,32),new Square(894,822,9,5,44)]
let map4Circles = [new Circle(1057.96875,16,4,61.07372593840988),new Circle(962.96875,54,4,14.866068747318506),new Circle(404.96875,132,4,22.02271554554524),new Circle(184.96875,69,4,20.024984394500787),new Circle(59.96875,67,4,20),new Circle(882.96875,133,4,14.142135623730951),new Circle(890.96875,249,4,17.029386365926403)]
let map5Circles = [new Circle(389.96875,280,5,71.06335201775947),new Circle(346.96875,280,5,77.92945527847606),new Circle(425.96875,439,5,8),new Circle(470.96875,438,5,12),new Circle(518.96875,438,5,9.055385138137417),new Circle(552.96875,397,5,11.045361017187261),new Circle(551.96875,362,5,13.038404810405298),new Circle(299.96875,447,5,25.238858928247925),new Circle(324.96875,443,5,18.867962264113206)]
let map6Circles = [new Circle(599.96875,330,6,13.892443989449804),new Circle(366.96875,278,6,76.00657866263946),new Circle(386.96875,284,6,73.10950690573696),new Circle(142.96875,178,6,12.041594578792296),new Circle(130.04409510198778,174.0078125,6,13.601480697536704),new Circle(232.0449785630765,60.0078125,6,20.518379508122223),new Circle(419.0465982417392,62.0078125,6,17.117244792645977),new Circle(415.04656359620634,90.0078125,6,22.803582948232627),new Circle(659.0486769737126,63.0078125,6,13.152949072028138),new Circle(690.0489454765926,61.0078125,6,13.928403823519659),new Circle(607.0482265817851,68.0078125,6,16.031220082165973),new Circle(628.0484084708328,75.0078125,6,14),new Circle(584.048027369971,81.0078125,6,16.124517645231),new Circle(831.0501667316271,454.0078125,6,28.42548828525679),new Circle(765.0495950803344,490.0078125,6,22.472229721633212),new Circle(808.0499675198129,492.0078125,6,45.65094067218403),new Circle(684.0488935082933,463.0078125,6,14.866127010225155),new Circle(744.0494131912867,479.0078125,6,11.313757495273405),new Circle(394.0463817071586,497.0078125,6,14.56022929645903),new Circle(256.04518643627387,475.0078125,6,17.20470087749703),new Circle(229.04495257892685,467.0078125,6,17.00003260767031),new Circle(194.04464943051406,475.0078125,6,20.808711985348125),new Circle(382.04627777056,380.0078125,6,15.264373837857004),new Circle(409.04651162790697,370.0078125,6,15.000083149408585),new Circle(252.045151790741,298.0078125,6,13.45367619463759),new Circle(260.04522108180674,319.0078125,6,12.530047727914598),new Circle(265.0452643887229,337.0078125,6,13.000095941537126)]
let map7Circles = [new Circle(829.96875,545,7,17.204650534085253),new Circle(253.96875,491,7,25.079872407968907),new Circle(256.96875,227,7,22),new Circle(686.96875,541,7,19.026297590440446),new Circle(540.96875,181,7,18.110770276274835),new Circle(395.96875,180,7,19),new Circle(251.96875,178,7,21.37755832643195),new Circle(251.96875,542,7,20),new Circle(395.96875,542,7,20.223748416156685),new Circle(541.96875,543,7,18.027756377319946),new Circle(686.96875,182,7,17.029386365926403),new Circle(827.96875,183,7,19),new Circle(75.96875,233,7,23.08679276123039),new Circle(91.96875,171,7,27.80287754891569),new Circle(127.96875,131,7,19.1049731745428),new Circle(168.96875,86,7,20.591260281974),new Circle(74.96875,494,7,21.18962010041709),new Circle(93.96875,551,7,21.095023109728988),new Circle(127.96875,603,7,17.804493814764857),new Circle(175.96875,647,7,17.69180601295413),new Circle(53.96875,353,7,52.773099207835045),new Circle(70.96875,191,7,29.68164415931166),new Circle(92.96875,125,7,37.48332962798263),new Circle(128.96875,81,7,38.8329756778952),new Circle(177.96875,45,7,41.182520563948),new Circle(59.96875,531,7,34.92849839314596),new Circle(89.96875,595,7,36.40054944640259),new Circle(128.96875,649,7,39.6232255123179),new Circle(190.96875,668,7,21.470910553583888)]
let map8Circles = [new Circle(746,80.79999923706055,8,31.304951684997057),new Circle(740,789.2000045776367,8,32.64965543462902),new Circle(158,176.79999923706055,8,18.439088914585774),new Circle(157,257.79999923706055,8,16.0312195418814),new Circle(160,341.79999923706055,8,16.0312195418814),new Circle(160,531.2000045776367,8,14.035668847618199),new Circle(150,615.2000045776367,8,26.076809620810597),new Circle(152,701.2000045776367,8,26.1725046566048),new Circle(505,767.2000045776367,8,7.0710678118654755),new Circle(587,765.2000045776367,8,5),new Circle(831,772.2000045776367,8,11),new Circle(916,772.2000045776367,8,8.246211251235321),new Circle(503,100.79999923706055,8,10),new Circle(585,98.79999923706055,8,12.041594578792296),new Circle(830,96.79999923706055,8,13),new Circle(920,95.79999923706055,8,16.76305461424021),new Circle(445,365.79999923706055,8,15.033296378372908),new Circle(587,366.79999923706055,8,12.041594578792296),new Circle(447,503.79999923706055,8,14.035668847618199),new Circle(587,505.79999923706055,8,12),new Circle(830,366.79999923706055,8,12),new Circle(970,366.79999923706055,8,15.620499351813308),new Circle(969,506.79999923706055,8,14.422205101855956),new Circle(836,506.79999923706055,8,15.231546211727817),new Circle(984,361.79999923706055,8,12),new Circle(985,506.79999923706055,8,12.165525060596439),new Circle(840,363.79999923706055,8,13),new Circle(1120,196.79999923706055,8,13),new Circle(1114,270.79999923706055,8,10),new Circle(1116,346.79999923706055,8,12),new Circle(1118,526.2000045776367,8,13.038404810405298),new Circle(1120,602.2000045776367,8,13.038404810405298),new Circle(1115,680.2000045776367,8,10)]
let maps = [new Game_Map(portals.slice(0,8),0,map0Squares,[]),
new Game_Map(portals.slice(8,9),1,map1Squares,[]),
new Game_Map(portals.slice(9,10),2,map2Squares,[]),
new Game_Map(portals.slice(10,11),3,map3Squares,[]),
new Game_Map(portals.slice(11,12),4,map4Squares,map4Circles),
new Game_Map(portals.slice(12,14),5,map5Squares,map5Circles),
new Game_Map(portals.slice(14,15),6,map6Squares,map6Circles),
new Game_Map(portals.slice(15,16),7,map7Squares,map7Circles),
new Game_Map(portals.slice(16,19),8,map8Squares,map8Circles),
new Game_Map(portals.slice(19,21),9,map9Squares,[])];
players.push(new Player(-1,-50,-50,-1,"VOITURES",0));
function updatePlayer(data)
{
if(data.id==player.id)
{
player.x=data.x;
player.y=data.y;
if(data.z==undefined)
player.z=0;
else
player.z=data.z;
}
else
{
for(let i=0;i<players.length;i++)
{
if(data.id==players[i].id)
{
players[i].x=data.x;
players[i].y=data.y;
if(data.z==undefined)
players[i].z=0;
else
players[i].z=data.z;
players[i].dir=data.dir;
players[i].visibleDir=data.visibleDir;
break;
}
}
}
}
function addPlayer(data)
{
let np = new Player(data.id, data.x, data.y, 0, data.name, data.dir);
players.push(np);
}
function removePlayer(id)
{
for(let i=0;i<players.length;i++)
{
if(players[i].id==id)
{
players.splice(i,1);
break;
}
}
}
function addKill(idKilled,idKiller)
{
if(player.id==idKiller){
player.kill++;
}
if(player.id==idKilled){
player.death++;
}
players.forEach((p) => {
if(p.id==idKilled)
p.death++;
if(p.id==idKiller)
p.kill++;
});
}
function updateBullets(dt)
{
for(let i = bullets.length-1;i>=0;i--)
{
bullets[i].update(dt);
bullets[i].checkCollisions(maps[bullets[i].z].squares,maps[bullets[i].z].circles);
if(bullets[i].deleted)
{
bullets.splice(i,1);
}
}
}