Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
JavaScript Game Create a flying bird game fun learn DOM
Rating: 4.5 out of 5(22 ratings)
4,061 students

JavaScript Game Create a flying bird game fun learn DOM

Use JavaScript connect with Elements and create a game while practicing learning JavaScript and Document Object Model
Created byLaurence Svekis
Last updated 11/2024
English

What you'll learn

  • How to use JavaScript
  • How to create elements dynamically
  • Manipulate elements using JavaScript
  • Explore JavaScript Document Object Model

Course content

2 sections31 lectures1h 30m total length
  • Flying Bird Game Introduction2:17

    Learn to build a flying bird game from scratch using JavaScript and the DOM, covering element selection, dynamic content, event listeners, keyboard controls, animations, and collision detection.

  • HTML CSS and JavaScript - Game Setup Structure4:16
  • Source Code0:18
  • Add Event Listeners - JavaScript element interaction4:00

    Add event listeners to the button, start screen, and document to track click and key press interactions, control the start sequence, and hide the game message using classList.

  • Source Code0:25
  • Keyboard event tracking - JavaScript KeyPress Events5:32
  • Source Code0:27
  • Add element to page - JavaScript Create Elements - createElement Method3:47

    Create a bird element with the createElement method, assign bird and wing classes, and append it to the game area to start the action.

  • Source Code0:38
  • JavaScript RequestAnimationFrame7:10

    Learn to implement smooth animations with requestAnimationFrame by looping a step function that updates a bird’s position using arrow keys and the element’s offset properties.

  • Source Code0:22
  • Move Conditions - JavaScript Game logic2:42
  • Source Code0:25
  • Wing Movements - Boolean values JavaScript3:56
  • Source Code0:32
  • Scoring and gravity - JavaScript game enhancements3:30
  • Source Code0:36
  • Game End Conditions - Game over with JavaScript4:17
  • Source Code1:11
  • Create Obstacles - Element creation using JavaScript9:15

    Create dynamic obstacles by generating top and bottom pipes with JavaScript, compute spacing, randomize heights, and render them via the DOM before the bird flies.

  • Source Code1:03
  • Moving Obstacles - Select Element and update style properties JavaScript5:39
  • Source Code1:12
  • Checking Collision Detection - JavaScript element properties check6:52
  • Source Code1:18
  • Handle Game Over on collision1:32

    Implement collision detection to trigger the game over function when the bird hits obstacles or goes off screen, display a game message, show the score, and allow starting again.

  • Game Code Review - Review game source code HTML CSS and JavaScript12:30
  • Bonus Add Color - Generate random color value JavaScript1:59
  • Source Code and Download1:51

Requirements

  • Fundamental JavaScript concepts
  • Access to computer
  • Use of editor to write code
  • HTML and CSS knowledge

Description

Fun and exciting way to practice JavaScript while building an interactive game from scratch.

Learn how to apply JavaScript - connect to elements - update and manipulate element content and attributes - create interaction with event listeners - create content dynamically - all done in a step by step format so you can learn explore and create your own version of the game.  Apply what you learn to your JavaScript projects to master working with the DOM.

Explore how you can apply JavaScript to :

  • Select elements from the web page

  • Create global variables and objects to use for game play

  • Add event listeners to create interactive content

  • Listen for keypress and apply the results in your code

  • Add classes and remove classes from elements

  • Create elements dynamically on the fly with JavaScript

  • Append new elements to existing webpage elements

  • Use offset values of elements within code

  • Update element style values to produce animation

  • Use of awesome JavaScript methods like getBoundingClientRect()

  • Smooth animations with requestAnimationFrame()

  • Check for element overlap and collision detection

  • How to build your game to be dynamic with flexible variables

  • and much more.

Source Code is included so you can try it for yourself, what is covered in the lessons.

No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.

Step by step learning with all steps included.

Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the game.  Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.  

Taught by a professional instructor with over 18 years of experience ready to help you learn.

Along with friendly support in the Q&A to help you learn and answer any questions you may have.

Try it now you have nothing to lose, comes with a 30 day money back guarantee.  

Start building your own version of the game today!!!!

Who this course is for:

  • Beginners to JavaScript
  • Anyone who wants to practice writing JavaScript
  • Web developers
  • Anyone who wants to learn to make a JavaScript game without any libraries
  • Beginners to JavaScript curious about Document Object Model and JavaScript Methods