GrandTabernacleAutoVI/js/game.js

37 lines
962 B
JavaScript
Raw Normal View History

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-15 09:09:13 +01:00
2023-11-18 20:17:47 +01:00
let playerId; //id of client player
2023-11-15 09:09:13 +01:00
let players = [new Player(1, 100, 50, "rubiks"),
new Player(2, 500, 70, "atsuyo"),
new Player(3, 600, 70, "vincent"),
new Player(4, 700, 70, "migliore"),
new Player(5, 200, 30, "leroux"),
new Player(6, 700, 700, "lele")];
2023-11-18 20:17:47 +01:00
Net.connect(); //connect to server, create a player, and retrieve all players info
2023-11-15 09:09:13 +01:00
players[0].retrieveServerInfo(1,100,50,3);
players[1].dir=5;
players[1].visibleDir=5;
Renderer.AddPlayer(players[0]);
Renderer.AddPlayer(players[1]);
Renderer.AddPlayer(players[2]);
Renderer.AddPlayer(players[3]);
Renderer.AddPlayer(players[4]);
Renderer.AddPlayer(players[5]);
setInterval(game);
function game() {
players[0].update([],[]);
players[1].update([],[]);
//console.log(Inp.calculateAngle(500,500))
Renderer.ReloadAff();
}