It seems you are curious about our Pong game implementation! We like curious minds, so here are a few things you can try to impress us with:
Feel free to show off your skills implementing one or more of the following challenges:
- Increase Unit Test coverage to 90% or above. For extra points, do not change this
jest
setting--env=node
- Revise the Object Oriented Model of the game, tell us how you would have modeled it instead. (extra points for a UML diagram)
- Change the shape and dimensions of the ball, how about instead of a simple square, a spinning letter "A" - for ADMIOS ;)
- Make the Canvas responsive!! Currently it has pixel-based
width
andheight
, can you make adapt to 100% of the dimension the DOM element its hosted inside?? - Add arrow keys support to move the player paddle
- modify the ball’s speed and trajectory when hit by a paddle factoring in the paddle speed and direction
Build pipeline is run using GitHUb Workflows. Refer to deploy.yml
for pipeline details.
To quickly browse the game:
To watch and recompile changes
To Run tests
To run tests in watch mode
To create an optimized production build (minified JavaScript) and create a test.html
page to test the artifacts. The build output is versioned based on the semantic version in package.json
with the following format: main_vx.x.x.js
Deploys the minified JavaScript assets and test page to Google Cloud Platform using a project configured for static hosting
- Add a reference to the deployed script
<script src="https://admios-pong.web.app/main_v<LATEST>.js"></script>
To get the latest version, check out the test playground page
The Game classes are added to the global window
object with the following namespace: window.admios.pong
- Instantiate a game instance and provide the
HTML
host element (e.g. a simple<div>
)
const root = document.getElementById("pong");
const { Context, Game } = window.admios.pong;
const game = new Game(new Context(root));
And that's it!
Enjoy playing and modifying the game!