This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert world coordinates to local screen pixels coordinates. | |
function worldToScreenCoordinates(player_global_pixel_position_x, player_global_pixel_position_y) { | |
// All players to this player distance. | |
let another_player_x_distance = players[current_player_ID].position.x - player_global_pixel_position_x; | |
let another_player_y_distance = players[current_player_ID].position.y - player_global_pixel_position_y; | |
// Get screen pixel coordintes from 0,0. | |
return [(windowWidth / 2) - another_player_x_distance, (windowHeight / 2) - another_player_y_distance]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Player attributes: | |
// 1 = ID | |
// 2 = Tail | |
// 3 = Block | |
// 4 = Shadow | |
while (true) { | |
for(player in rooms[room_name].players) { | |
let time = process.hrtime(); |