banner



How To Create Game In Html

Although Flash games have departed from this world, there is still a significant demand for browser-based and cross-platform games. Whether you yourself actively play them or not, more and more games from professional and indie developers alike come out each day.

This phenomenon is largely thanks to HTML5 games which have filled the gap to keep up with these eager gamers. In addition, thanks to the advancement of technology and new frameworks, HTML5 game development has reached extensive heights, allowing for multiplayer experiences, 3D graphics, and more! It is not unwise to say that gaming is now just as viable via a browser as it is on many other devices!

Assuming this sounds like an exciting prospect to you as a game developer, in this guide we're going to delve into the topic of HTML5 game development and give you the run-down of how you can make your own games! Sit back, relax, and prepare to enhance your game development skills in entirely new ways!

What exactly is an HTML5 game?

Let's start from total zero. What is HTML5? that's a tricky question. There is a official definition of HTML5, which simply stands for the latest revision of HTML (the markup language used all over the world to build websites), and the more hyped definition (what most people understand when HTML5 is mentioned) which is all the "new" features of the web technologies that have come out in the last few years (JavaScript API's like the Canvas or WebAudio, semantic HTML tags, etc).

For our purpose we'll use bits of the two. HTML5 is HTML in it's latest version, which includes a whole bunch of cool features that make the web technologies an open standard with endless possibilities combining HTML, CSS and JavaScript.

Having HTML along with all these super powers that go beyond making a simple website allows us to make, among other things, games. These are HTML5 games.

Don't miss out! Offer ends in

  • Access all 200+ courses
  • New courses added monthly
  • Cancel anytime
  • Certificates of completion

 Building blocks

The very basic building blocks of a HTML5 game are those of the web:

  • HTML
  • CSS
  • JavaScript

Similarly to what happens with HTML5, when people talk about CSS3 they usually refer to the new things that come with CSS's latest specifications, but in an analog manner, CSS3 is simply the latest CSS. Ignoring for a second the semantics of these definitions and thinking of the hyped versions of these terms, we also may need, in order to make HTML5 games:

  • HTML5 (JavaScript API's)
  • CSS3

With the above you can make awesome games that will run on modern web browsers on mobile and desktop, but some games might require more features, so there are more building blocks that you can add.

For instance, you may want to make 3D games. If that is the case there is also WebGL, which is a JavaScript API to render 2D and 3D graphics on the browser, using the GPU for greater performance.

Road crossing game made with HTML5

Server side

If you want your games to saved data remotely you'll need a server-side for your game. You can develop your own backend using any server-side language, you'll need well a server in this case.

  • JavaScript (NodeJS)
  • PHP
  • Java
  • Python
  • Ruby

Or you can use a third-party Backend-as-a-Service provider such as Firebase. Some have free versions you can use and they'll start charging you once you surpass certain limits. Some of these providers are particularly focused on games, some are mostly conceived for mobile apps but can be used for games too.

How to distribute a HTML5 game

The easiest way to distribute a HTML5 is to simply put it out there! By being built as a website, you can just embed it in on a page and publish it. Just like that.

If you want to distribute it through proprietary platforms you have to go through a process called wrapping. Basically, you create a native app for the platform you wanna distribute it to (iOS, Android, etc) and put your game inside so that this app acts like a web browser and "runs" your game.

For desktop platforms such as Windows, Mac or Linux there is a tool called NWjs that allows you to pack your HTML5 games for these platforms.

We can only cover the basics here, but we encourage you to read our more in-depth advice about publishing games.

Match 3 game made with HTML5

HTML5 game frameworks

Most games share some concepts, that of sprites (graphic elements that represent enemies, players, elements in your game), scenes or stages, animations, sound, loading graphic assets, etc. Since most game developers want to focus on their actual game and not in creating this whole abstraction layer, it is recommended you use a HTML5 game frameworks.

HTML5 game frameworks and libraries that contain building components you can use to create your own games. These libraries are Open Source projects created and maintained by people who want to contribute to the HTML5 gamedev environment. In many cases they created the frameworks for their own games, and after realizing that other people would want to not only use it but also contribute to it they released them as Open Source code, so everybody wins.

Picking what game engine to use is an important decision, so make sure you do proper research before making your choice. No matter what engine you pick, you will have to get familiar with its code and inner working if you want to use properly, so they shouldn't be treated as black boxes.

What can help you make your choice:

  • Is your game for desktop, mobile or both?
  • Do they have an active community?
  • Are there many people using the framework nowadays?
  • Is it being maintained or the Github page looks like an abandoned town?

Sometimes looking at real games gives you more insight than just words. This project compares different engines by making the exact same Breakout game in all of them.

Some popular free frameworks are:

  • Phaser –> The most popular these days
  • CreateJS
  • LimeJS
  • Quintus
  • CraftyJS
  • MelonJS
  • PixieJS
  • BabylonsJS –> WebGL framework for 3D rendering
  • PlayCanvas
  • ThreeJS
  • KontraJS
  • Matter.js

Solar system project made with Babylon.js

HTML5 game development courses

Video courses are a great way to learn new technologies. The main difference between a video course and just watching YouTube videos is that there is more structure. Good courses have a clear goal and build on to it step by step. Below a list of courses and tutorials by Zenva that can give you the tools you need to create HTML5 games.

General Game Development

  • 10 Best Ways to Learn to Code
  • How to Make a Game – Making Video Games from Scratch
  • How to Code a Game
  • How to Design a Game: Game Design Documents
  • How to Approach Game Narratives

Phaser

  • HTML5 Game Development Mini-Degree (Premium curriculum covering the creation of multiple mini-games with Phaser)
  • MMORPG Academy (Premium curriculum that teaches how to create online RPGs with Phaser, Node.js and MongoDB)
  • Phaser 4 Tutorials – Complete Guide

WebGL, 3D, and XR

  • 3D & XR JavaScript Academy (Premium curriculum covering a variety of JavaScript frameworks for 3D and XR experiences on the web)
  • WebVR for Beginners – Build VR Websites with A-Frame (Premium course on A-Frame)
  • Learn the Basics of Babylon.js (Free course on Babylon.js)
  • Marker-Based Games with AR.js for Beginners (Premium course on AR.js)

HTML5 Skills

  • Learn HTML and CSS (Free couse)
  • JavaScript Programming for Beginners
  • JavaScript Mini-Projects – Language Learning Game
  • Modern JavaScript – From ES6 to ES9
  • Discover Developer Tools for JavaScript Apps

Server-Side Development (to make a backend for your games)

  • Node.js and Express for Beginners
  • User Authentication with Node.js and Express
  • Web Authentication UI for Express and Node.js
  • Real-Time Server Communication with Socket.io

HTML5 game tutorials

At the GameDev Academy, as you know already we have a bunch of HTML5 game development tutorials, mostly on Phaser, LimeJs, Quintus and BabylonJS. There are other great places to find good quality HTML5 gamedev tuts:

  • Build New Games
  • Gamedevtuts+
  • HTML5 Game Development (news and links to tutorials)
  • Phaser Tutorials
  • Mozilla Game Tutorials
  • HTML5 Game Tutorial
  • HTML5 Games with JavaScript & Phaser
  • JavaScript HTML5 Game Development Tutorial
  • HTML5 Game Development Tutorials

HTML5 gamedev communities

You can find plenty of active communities on the Internet, some focus on gamedev in general and some others just in HTML5 gamedev.

Web:

  • HTML5GameDevs

Facebook:

  • Indie Game Developers
  • Indie App and Game Developers Group
  • Game Development
  • Video Game Developers

Other Communities:

  • Phaser Forum
  • reddit
  • GAMEDEV.JS
  • Babylonjs Froum
  • Threejs discourse

HTML5 gamedev challenges

  • One Game a Month is one of the most active initiatives on the web for starting game developers. It consists on a pledge of making 1 game per month, no matter how basic or ugly. You make one game, you move on. It's a great community and I recommend you check it out.
  • j13k competition: Contest to make a HTML5 game of only 13 kb, quite a challenge! the 2013 competition is over but don't miss out 2014's!

 HTML5 gamedev podcasts

I just know Lostcast, a podcast created by the guys from Lost Decade Games (whom we've interviewed in the past). In the podcast episodes they talk about they HTML5 games and game development in general.

Related Posts

How To Create Game In Html

Source: https://gamedevacademy.org/how-to-make-a-html5-game/

Posted by: epleymisibromes.blogspot.com

0 Response to "How To Create Game In Html"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel