Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
JavaScript Game Code Project make a Breakout Game Exercise
Rating: 4.6 out of 5(31 ratings)
2,137 students

JavaScript Game Code Project make a Breakout Game Exercise

Learn more about JavaScript functionality how you can make page elements dynamic and interactive all using JavaScript
Created byLaurence Svekis
Last updated 11/2024
English
English [Auto],

What you'll learn

  • Build a simple interactive JavaScript based Game
  • Apply JavaScript animations
  • Apply and practice JavaScript
  • Learn and explore whats possible with JavaScript and the Document Object Model DOM

Course content

2 sections22 lectures1h 44m total length
  • JavaScript Breakout Introduction2:30

    Build a breakout game from scratch using pure javascript and the DOM, featuring ball and paddle movement, collision detection, animations, and the included source code.

  • PreGame HTML page setup7:49

    Set up a pregame HTML page for a breakout game with a head and body. Include a main container, start button, score, lives, and elements like ball and paddle.

  • Interactive with JavaScript4:04

    Learn to make a browser game interactive by selecting DOM elements (container, ball, paddle, start button), wiring event listeners for click, keydown, and keyup, and scaffolding the start game logic.

  • JavaScript Functionality7:30

    Set up game variables including game over, game in play, score, lives, animation frame, ball direction, and speed, and use the container dimensions with get bounding client rectangle.

  • StartGame Animations JavaScript4:55

    Set up game state, visuals, and start logic for a breakout-style game using JavaScript, showing the ball on start, hiding game over, and using requestAnimationFrame to drive the animation loop.

  • JavaScript Get Moving5:20

    In this lesson, learn to implement smooth paddle movement with an animation frame loop, responding to left and right keys while enforcing container boundaries and paddle width.

  • Source Code 50:57
  • Bouncing Ball JavaScript10:20

    Move the ball with the paddle, implement ball release, manage x/y positioning, and bounce off walls by reversing direction, preparing collision detection in a future lesson.

  • Source Code 61:07
  • Detect Collision JavaScript8:16

    Learn to implement collision detection in JavaScript games by comparing bounding boxes of two elements (ball and paddle) using getBoundingClientRect, computing corners and overlap to trigger actions.

  • Source Code 71:19
  • Paddle Ball Hits JavaScript4:08

    Enhance a breakout game by adjusting ball direction on paddle collision using dynamic hit-position calculations, map hit location to horizontal direction, and prepare launching the ball after a pause.

  • Tweak gameplay update JavaScript5:46

    Launch the ball when the game is in play, reset the ball to the paddle if it falls off the edge, and update lives while stopping the animation.

  • Bring the Bricks create targets to hit11:19

    Create dynamic brick elements for a breakout game, position them with absolute left and top, and attach data attributes to store each brick’s point value.

  • Source Code 101:51
  • Brick Collision Detection and Hits5:15

    Use collision detection to identify ball-brick hits, reverse the ball direction, remove the brick from the screen, and update the score with brick point values.

  • Tweak and Tune our Code7:50

    Tweak gameplay by applying random brick colors via a hex color generator, restart the game when all bricks vanish, and expand the board with an extra row.

  • Updates to Game Play - play the game3:20

    Fix end-game bugs by preventing brick duplication and keeping lives above zero, then clear all bricks for a fresh game. Experiment with brick counts, ball speed, and gradient colors.

  • Source Code Review9:41

    Move styling to a CSS file and JavaScript to script.js, then link them in the index to clean up the code and enable a breakout game.

  • Source code and Resources0:28

Requirements

  • Basic JavaScript HTML and CSS
  • Computer Access
  • Desire to learn

Description

Learn and practice JavaScript with this fun game building exercise course

BUILD a - JavaScript Breakout game from scratch

Learn JavaScript and have fun doing it, building an exciting playable game within the course.

Source Code is included!!!!  Work along side the lessons to build your own version of the game.

Did you want to PRACTICE and LEARN more about using JavaScript, then this course is perfect for you to advance your skills in a fun step by step course teaching you how to build a game from scratch.

Within the course we explore animation functionality and how to apply it within your code to make things happen.

How you can use JavaScript to create and update elements within your page.  Setup animations and move things around.  JavaScript is designed to make your web content interactive and dynamic which is demonstrated within the building of a game only using JavaScript.

JavaScript is a prerequisite to this course, The course is designed to practice JavaScript and prior knowledge of JavaScript is needed to take this course.

All JavaScript no libraries and no filler, JUST JavaScript !!!!

The possibilities are endless, using the DOM and creating elements provides you a wide variety of options where you can take the code provided within this course and extend on it in any number of directions.   Learn practice and have fun.

Source Code is included to get you started quickly

Fast friendly advice and help is always available within the Q&A section

Taught by an instructor with many years of web development and teaching experience.

Learn step by step how to create a simple game from scratch, with helpful tips and resources along to way.   Explore how game logic is applied and tweaks for coding and game improvement.

Nothing to lose, join now and see what you can build with JavaScript.



Who this course is for:

  • Anyone who wants to learn how to put together a quick game using only Vanilla JavaScript
  • Anyone who wants to practice and learn more about how to use JavaScript
  • JavaScript Beginners