Created
January 31, 2019 23:28
-
-
Save willyandan/1650cc1cec9aaf7fc4eb03f82fe5b436 to your computer and use it in GitHub Desktop.
pong.js - draw
This file contains hidden or 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
function draw(){ | |
// fundo | |
drawRect(0,0,w,h,"#000") | |
// player 1 | |
drawRect(p1_x, p1_y, p_w, p_h) | |
// player 2 | |
drawRect(p2_x, p2_y, p_w, p_h) | |
// barra lateral | |
drawRect(w/2 -5,0,5,h) | |
// bola | |
drawRect(ball_x, ball_y, 10, 10) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment