2023-11-15 09:09:13 +01:00
|
|
|
Renderer = new Render("canvas", "./assets/map/map7_recadr.png");
|
|
|
|
Inp = new Input("canvas");
|
2023-11-17 19:25:26 +01:00
|
|
|
let Net = new Network("ws://129.151.227.50:9600/");
|
2023-11-19 19:20:02 +01:00
|
|
|
let ClientKeyboard = new Keyboard()
|
2023-11-15 09:09:13 +01:00
|
|
|
|
2023-11-18 20:17:47 +01:00
|
|
|
|
|
|
|
let playerId; //id of client player
|
2023-11-19 18:38:27 +01:00
|
|
|
let players = [];
|
2023-11-15 09:09:13 +01:00
|
|
|
|
2023-11-18 20:17:47 +01:00
|
|
|
Net.connect(); //connect to server, create a player, and retrieve all players info
|
2023-11-19 19:20:02 +01:00
|
|
|
ClientKeyboard.init();
|
2023-11-18 20:17:47 +01:00
|
|
|
|
|
|
|
|
2023-11-15 09:09:13 +01:00
|
|
|
function game() {
|
2023-11-19 18:55:21 +01:00
|
|
|
for (var i = players.length - 1; i >= 0; i--) {
|
|
|
|
players[i].update([],[]);
|
|
|
|
}
|
2023-11-15 09:09:13 +01:00
|
|
|
//console.log(Inp.calculateAngle(500,500))
|
|
|
|
Renderer.ReloadAff();
|
2023-11-19 19:20:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
setInterval(game);
|