Skip to content

Instantly share code, notes, and snippets.

@willyandan
Created February 1, 2019 03:18
Show Gist options
  • Save willyandan/34166162b6399628f26b29349368a5d4 to your computer and use it in GitHub Desktop.
Save willyandan/34166162b6399628f26b29349368a5d4 to your computer and use it in GitHub Desktop.
pong.js - writePoints
function writePoints(){
ctx.font = "50px monospace";
ctx.fillStyle = "#fff";
// w/4 = 1/4 da tela = metade da tela do player 1
ctx.fillText(p1_points, w/4, 50);
// 3*(w/4) = 3/4 da tela = metade da tela do player 2
ctx.fillText(p2_points, 3*(w/4), 50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment