HTML5 Simple Game Programming Preparation

Free overview of HTML, CSS, and JavaScript for my HTML5 Game Development course.
4.2 (172 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
18,104 students enrolled
Free
Start Learning Now
  • Lectures 24
  • Length 5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2014 English

Course Description

Learn to build web and mobile games with HTML5. Even if you have no experience in programming or web development, you can create your own games.

This course begins with a quick overview of web development in HTML5 and shows you the basic web framework used in all modern pages. It then teaches essential programming concepts using the JavaScript language embedded in all modern browsers.

It introduces the simpleGame.js engine, showing you how the engine works and introducing a free online game development tool. For more information on game programming, please see my other course.

What are the requirements?

  • Access to an HTML5 - compliant browser (Google Chrome 23 or greater recommended)
  • Access to a higher-end text editor (specific examples linked in course)
  • Any major operating system (Windows 7+, Mac OSX, Linux)

What am I going to get from this course?

  • Build a basic web page with HTML
  • Use CSS to add essential style to your page
  • Understand the main concepts of programming (variables, conditions, loops, branches, functions, and arrays) using JavaScript
  • Use JavaScript and the Document Object Model to build a basic interactive web page
  • Discover the free simpleGame.js game library and use the online practice tool to begin building your own games online!

What is the target audience?

  • Anyone interested in game development.
  • Suitable for middle school, high school, or adult learners. Motivated younger students will also enjoy the course, but they may need help from an adult. Perfect course for kids and parents to take together!
  • No prior experience in web development or programming is necessary, although it can be useful.
  • Programming is NOT a spectator sport! You'll only learn if you're willing to do some exercises on your own.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Building a basic page - and an epic adventure
Introduction to the Free HTML5 Preparation class
09:42
08:04
Your first game will be a basic "choose your own adventure" written with HTML and CSS.  Take a look at a simple sample game and see how you will build this project.  

The video features the game you can find here. Open the game in your browser and use ctrl-u (or the 'view source' command) to view the code.

18:33
Resources mentioned in this lecture:

11:10

Pages mentioned in this lecture:

10:03

Change how your web page looks by adding CSS.

Files used in this example:

Note that we're deliberately discussing a very small subset of CSS. If you want to learn more about CSS, please see my book HTML / CSS All in One for Dummies.

14:23

Think about the design of your adventure game and how you will implement it in HTML and CSS.

Create your nodes, make your images into links, and add sound effects for even more fun.

Files demonstrated in this video:

Building an adventure game with basic HTML and CSS
12 questions
Section 2: Talking to the Page
03:12

Files used in this video:

wordStory.html

10:47

Files used in this video:

input.html

20:54

Files used in this video:

greet.html

greetName.html

greetOutput.html

14:17

Learn to build the form for the word story game. While you already know all the HTML code you need for this game, the code won't look good on its own. Add a floating CSS layout to make the page look great.

Code used in this lecture:

WordStory.html

WordStory.css

Form.css (Use this in your own forms to add a floating layout.)

11:43

Put together all you've learned to build the word story. Tie together HTML, CSS, and JavaScript code. Files used in this video:

wordStory.html

wordStory.css

wordStory.js

Basic input and output
12 questions
Section 3: Coding Like a Pro
14:05

Learn how JavaScript works with data, and a surprising error you can get when you trust the computer too much. Prevent this type of error by converting data to the format you need.

Programs used in this video:

TypeConv.html

19:47

Computers seem to make decisions when programmers use a concept called a condition. Learn how to build your own conditions in several variations of the if statement.

Examples used in this video:

if.html

ifElse.html

ifElseIf.html

nestedIf.html

switch.html

Note if you're using the "HTML5 Game Programming for Dummies" book, these examples were actually taken from another book with a bit more detail (HTML5 / CSS3 All in One for Dummies) I didn't have as many examples on the HTML5 Gaming page, so I borrowed from another book for clarity.

11:10

Often you'll need the computer to do something a certain number of times (Each alien in your game might need to drop a bomb, for example.) Programming languages have a structure called a "for loop" for exactly this situation. Look at a number of for loops to see how the computer can count efficiently.

File viewed in this video:

forLoops.html

24:49

The while loop is a more flexible alternative to the for loop. Learn how to build a well-behaved while loop. You'll also learn how to build a loop that can exit in multiple ways, and how to watch your code run line-by-line to detect logic errors.

Files used in this video:

while.html

logicError.html

15:00

You've been using simple functions, but now you learn how to make them work well with the rest of the program. Add parameters to input values into functions, and use return values to have functions produce a value.

Files used in this video:

param.html

16:37

If functions are used to put together multiple instruction, you might wonder if there's a way to group data as well. Of course, there is such a concept, and in programming this is the array. Learn to build arrays in a couple of ways. Learn how for loops are the natural companion to for loops, and how to access and modify data in an array.

Files used in this video:

basicArrays.html

antsArray.html

Coding like a pro
9 questions
Section 4: Building a text-based game
07:55

With all the basic programming concepts covered, you're ready to build a basic text-based game. Take a look at the game, then learn about how to plan a game to make the programming as easy as possible.

Files used in this video:

numGuess.html

highLow.png

09:45

Games often include random behavior. Computer programs use random number generation for practically all random numbers. Learn how to build a random number within any range of values.

Files used in this video:

rand100.html

11:17

Take all the concepts you've learned up to now and build a complete text-based game! This game features HTML, CSS, JavaScript, conditions, functions... pretty much everything we've done so far.

Files described in this video:

numGuess.html

numGuess.css

numGuess.js

Section 5: Introducing the Game Engine
12:17

HTML5 doesn't directly support game programming, but there are a number of libraries which add support for the main aspects of gaming. Learn about the simpleGame library, designed specifically to be easy to learn and use while building great games. Look at a simple animation which demonstrates the basic use of this engine.

Files used in this video:

redBall.html

Please be sure to run this (and all files in this course) directly, as the performance in the videos tends to be more jerky than in real life.

13:58

Overview of the simpleGame engine. Learn how to find the latest version of the engine, how to download it for use in your own games, and see the main features of the engine.

Files used in this video:

book main page Main page for this course's companion book

simpleGame.js Version of the simpleGame library used in this course

simpleGame Documentation Official documentation of the simpleGame library

template Save a copy of this code for a convenient starting place for your games

10:50

The most obvious difference between a game and an animation is user interactivity.

Learn how to check for keyboard input, how the keyboard array works, and how to set up an image for use in game animation.

Files used in this video:

car.html

car.png car image used in game. Note images should face to right and have a transparent background.

09:55

Learn how to use a special online tool to build experimental games even if you don't have anything installed on your computer. Play around with the simpleGame engine any time you can get to a web browser.

Files used in this video:

simpleGamePractice.html

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Andy Harris, Teacher, Author, Game Developer

  • Andy is the author of over a dozen books on various topics in computer programming, especially web, game, and mobile development.

His best-selling books include

  • HTML5 / CSS3 All in One for Dummies
  • HTML5 Game Programming for Dummies
  • HTML5 Quick Reference for Dummies
  • PHP6 / MySQL Programming for the Absolute Beginner
  • Game Programming - the L Line (using Python)
  • Flash Game Programming for Dummes

He teaches computer science at a major university teaching the following courses:

  • * Computer Science I - Introduction to computer science and programming with Python
  • * Computer Science II - Advanced computer programming in C, C++, Java, basic algorithms and Data Structures
  • * Game Development I and II - 2D and 3D game development from the ground up, including building game engines.
  • * Web and Mobile Development - Various classes in client-side, server-side, and AJAX programming, as well as mobile development.

Andy is also very active in homeschooling. He has taught math and programming classes to various homeschooling groups, and is a featured technology columnist in The Old Schoolhouse magazine, a leading magazine among homeschool families.

While Andy's technical depth is notable, it's his teaching style that makes the biggest difference. He has served as a special education teacher, and knows a little about how to help smart people become even smarter by learning new complicated tasks.

Andy is particularly interested in helping kids and adults who do not have access to computing instruction learn how to get started in this fun and lucrative field.

He has a great time teaching, and his courses are engaging and fun, while informative. A course with Andy is like having a friend who's written a lot of books come by in a sweater on a Saturday morning showing you how to do cool stuff. You'll learn a ton, and you'll have a great time doing it.

Ready to start learning?
Start Learning Now