Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
HTML5 Game from scratch step by step learning JavaScript
Rating: 4.3 out of 5(483 ratings)
55,307 students

HTML5 Game from scratch step by step learning JavaScript

Learn how to create HTML5 and JavaScript games from scratch Step by step tutorials with real HTML5 code examples
Created byLaurence Svekis
Last updated 11/2024
English

What you'll learn

  • create animations using javascript
  • add objects to the canvas
  • use html5 to interact between JavaScript and canvas
  • apply Collision detection, enemy movement, game interactions and more
  • create basic games
  • understand concepts on html5 game creation

Course content

2 sections32 lectures2h 19m total length
  • HTML5 Game Course Introduction3:39

    Learn to build a complete HTML5 canvas game from scratch using JavaScript, including setup, images, keyboard input, collision detection, animation, and rendering, with source files and CodePen resources.

  • resources for course1:00
  • Setup HTML5 Game template3:01

    Declare the HTML5 document type, set up head and body, and create a canvas with width 600 and height 400 to start the HTML5 game template.

  • HTML5 Game connect canvas to Javascript5:10

    Connect an HTML5 canvas to JavaScript using getElementById and getContext, draw on a 2d context, and ensure the script runs after the DOM loads.

  • Source Code 11:00
  • HTML5 Game Use JavaScript to create canvas3:26

    Learn to create a canvas with JavaScript, set its size, append it to the document body, and ensure it loads for dynamic HTML5 game elements.

  • Source Code 21:00
  • Setup GameBoard HTML510:40

    Load an image into a canvas and set up a Pac-Man style game with dots and ghosts, including blue ghost mode, using a render loop to start the game.

  • HTML5 drawimage selecting image pieces9:44

    Learn to render a fragment of a loaded sprite sheet onto a canvas using drawImage, specifying source x,y,width,height and destination x,y,width,height, with Pac-Man and ghost examples.

  • drawimage sourcecode3:00
  • HTML5 Draw Text setup dynamic variables8:03
  • HTML5 Game setting event listeners6:40

    Set up keydown and keyup listeners, track key codes, and move the player while rendering the updated position in an html5 game.

  • HTML5 Game active keyboard5:50
  • source 4 keyboard1:00
  • HTML5 Game movement5:48
  • HTML5 Game create an enemy6:54

    Learn to add an enemy in an HTML5 canvas game using requestAnimationFrame to loop rendering, draw a ghost, and manage layer order with Pac-Man.

  • HTML5 Game random enemy creation6:02

    Implement a random ghost system for an HTML5 game using Math.random and floor to pick a color and a position, and render it only when it doesn’t already exist.

  • HTML5 Game enemy moving9:24

    Learn to implement a moving enemy in an HTML5 game with random direction changes, variable speed, and player-aware decisions, including screen wrap for continuous motion.

  • Source Code 5 with enemy1:00
  • HTML5 Game calculation adjustments3:05

    Adjust calculations to keep the enemy from running off the page, tweak speed and direction, and explore collision detection and power dot integration for Pac-Man to eat dots and ghosts.

  • HTML5 Game adding powerup pill9:01

    Add a power up dot to a canvas game by placing it at random x and y coordinates, toggling visibility, and drawing a yellow arc for Pac-Man style gameplay.

  • HTML5 Game collision detection10:00
  • Source code 6 collision detection1:00
  • HTML5 Game powerup functions6:50

    Power up the ghost with flashing eyes and image toggling driven by a countdown, while implementing collision detection and dot-eating logic that resets color and triggers escape.

  • HTML5 Game runaway ghost1:59

    Learn how to make the ghost reverse direction after a power dot is eaten by inverting its speed. Set up collision detection for power dot events.

  • HTML5 Game hit test ghost8:41

    Refine ghost collision detection, implement score updates for player and ghost, and reset positions after collisions in this HTML5 game. Adjust hit areas and enable ghost movement for smoother gameplay.

  • Game source 75:00
  • HTML5 Game tweaking the game4:32

    Slow eye blinking and preserve white and blue flashes when pursuing, using a countdown to control blink timing. Increase speed after power-ups and fix power-dot placement.

  • HTML5 Game add a second enemy8:39
  • Source Complete6:00
  • Source Code with Image as base642:41

Requirements

  • a computer
  • desire to learn

Description

Crash course to learn how to create an HTML5 game from scratch for beginners.

Core HTML5 training using canvas and setting a gameboard. Adding text and dynamic variables. Using event listeners to determine keyboard actions and create movement. Create a random enemy and have it move around. Interacting with game items like a power up pill. Collision detection to determine multiple reactions to object interactions on the game board. Tweaking and fine tuning game interactions for better game play.

This course is designed for anyone who wants to better understand how to create their own HTML5, within this course we show you how to make a basic HTML5 game from scratch. You can reuse and practice with the sample code in the course.

We start with a blank document, add in html and then JavaScript to create the game.

The game we create in the course is a pacman type game with a pacman character that can be moved around the screen. There are also 2 ghosts which move towards the player or away if the pacman is powered up.

We walk you through step by step with detailed explanations of code and more.

  • quick lessons get right to the point
  • fully covered topics with real world examples
  • source files downloadable to work along
  • challenges and lessons and code samples
  • code snippets
  • Links to top resources to save time
  • 30 day money back guarantee
  • new course material added regularly
  • trusted name in education since 2002
  • full HD easy to read source coding
  • quick response support to students
  • regular discussions

We teach you the latest techniques and tools to use in order to create html5 canvas animations and content. Everything you need to know is included in this course. Learn at your own pace, lifetime access to this course.

Who this course is for:

  • anyone interested in learning about HTML5 game development
  • using JavaScript and html5 canvas
  • online web developers
  • application developers