A long time ago (Netscape 4-era), I wrote Javascript-based games: Pong, Minesweeper, and John Conway's Life among them. I'm getting back into it, and want to get my hands even dirtier.
I have a few games in mind:
In all of these, I have only a few objectives:
So my questions are:
N.B. I also want to start from first-principles - if you recommend a framework/library, I would appreciate some theory or implementation details behind it. These games are different enough that I should learn something new from each one.
The very basic building blocks of a HTML5 game are those of the web: HTML. CSS. JavaScript.
In short, HTML5 offers the ability to create cross-browser and cross-platform games. It means you'll have to code once and can deploy the game anywhere. It'll not only save you effort but lots of money as well. It's because you won't have to create different games for different platforms.
Yes! JavaScript is a great language for game development, depending on the type of game you want to create. JavaScript is best for web-based and mobile games. It's also a great language for kids to learn because it's generally easy to understand and has plenty of resources for coders readily available online.
JavaScript: JavaScript is widely known as one of the foundational technologies of web development, powering over 95 percent of websites across the globe. With the adoption of HTML5 for gaming, JavaScript has also become the core pillar of HTML5 game development in terms of programming languages, says GameDevAcademy.
Depends how much you want to start from scratch. To answer your direct questions:
1) How would you implement these games?
A: JavaScript + Canvas. Canvas is the 2D drawing surface from HTML5. Performance is pretty good on desktop machines, not so great on iOS and Android devices (as of the date of this post). If mobile is your utmost concern, you need to use the DOM and CSS3 3D transforms which trigger the GPU on those devices.
2) Do you have any technology recommendations?
A: This is sort of answered by the first question. JavaScript is a must, but I would ignore jQuery. You are targeting HTML5 devices, so no need to compensate for legacy browsers. As you are probably using Canvas, no need to smooth over the DOM interaction, either. There are some higher level libraries which make interacting with Canvas easier, such as Easel.js. WebSockets are useful for bi-directional streaming communication. And Box2D is useful for a physics engine. Local Storage is simple key/value string data for things like level progress, but for anything complex, you'll want WebSQL DB. For large binary assets you'll want to look at the File System API. Finally, don't be afraid of WebGL, as it is extremely fast and useful for 2D games.
3) What is the hardest part?
A: Almost certainly the hardest part is the debugging. WebKit's Developer Tools can make this easier, so don't leave home without them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With