showing results for - "pong game using sketch files in js"
Marius
07 Apr 2018
1// define initial player score
2var playerLeft = playerRight = 0
3
4// create text for the score, set font properties
5var scoreLeft = draw.text(playerLeft+'').font({
6  size: 32,
7  family: 'Menlo, sans-serif',
8  anchor: 'end',
9  fill: '#fff'
10}).move(width/2-10, 10)
11
12// cloning rocks!
13var scoreRight = scoreLeft.clone()
14  .text(playerRight+'')
15  .font('anchor', 'start')
16  .x(width/2+10)