// Handle movement for Player 1.function update_player1() { _player1.x += _player1.velocity_x; _player1.y += _player1.velocity_y;}
script.js:
// Handle movement for Player 1.function update_player1() { ...}// Handle movement for Player 2.function update_player2() { _player2.y += _player2.velocity_y;}
script.js:
// This is called ~60 times per second to update the world.function update_world() { check_input(); update_player1(); update_player2(); draw(); requestAnimationFrame(update_world);}