A simple ping-pong game as a React component composed in ES6.
Inspired by Max Wihlborg
npm install --save react-pong
import Pong from 'react-pong';
React.render(
<Pong/>,
document.getElementById('container')
);
height
- Number - Height of canvas element in px - default: 600width
- Number - Width of canvas element in px - default: 700,upArrow
- Number - Keyboard code for moving paddle in up direction - default: 38downArrow
- Number - Keyboard code for moving paddle in down direction - default: 40ballSize
- Number - Diameter of ball in pixels - default: 10paddleHeight
- Number - Height of both paddles in pixels - default: 100paddleWidth
- Number - Thickness of both paddles in pixels - default: 20paddleSpeed
- Number - Number of pixels moved by player paddle on key press - default: 5