JS Breakout Part 1 (Paddle and Ball)
Mt. Ford Studios
In the first part of this JavaScript tutorial to recreate the 1976 game, Breakout, we create the game paddle and the bouncy ball. We use the more modern requestAnimationFrame() function to create the game loop. We add some controls to allow the user to move the ball left and right using the arrow keys, and serve the ball by pressing the space bar. We program the ball to bounce off the walls as well as the paddle itself. When the ball strikes the paddle, we add a slight deviation to the angle so that the ball doesn’t constantly travel along the same path.
If you’d like to learn how to program a browser-based game in JavaScript, please feel free to download the code below!
CODE JavaScript Template: https://drive.google.com/open?id=1W8vbBTBFf7gBTnZ04bNSy6ywRgRSSeQN Breakout Part 1 (Paddle and Ball): https://drive.google.com/open?id=10-dH62BYlvPY20OeZo5VPWP92jWXvgjE
USEFUL LINKS Breakout information: https://en.wikipedia.org/wiki/Breakout_(video_game) MDN requestAnimationFrame(): https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame Visual Studio Code: https://code.visualstudio.com/
FIND US ON FACEBOOK https://www.facebook.com/MountfordStudios/ ... https://www.youtube.com/watch?v=7UQYG5x9rZo
86284042 Bytes