Build a Multiplayer game using Javascript

In this tutorial, we will take a look at how to build a multiplayer game using Javascript and NodeJS. My goal is to take you through the basic setup so that you can begin focusing on the actual gameplay. When building a full-scale MMO, there are a lot of things to consider like load balancing, network contingencies, etc. For now, we are going to focus on the bare minimum just to help you get an understanding of how you can creatively and effectively use the available tools of NodeJS to get started.

Javascript Hashcash Proof of Work

Suppose that you developed an app that will give users free stuff when they click a button. Obviously, there’s nothing stopping one user from spamming the button one million times and collecting a whole bunch of free stuff. If you wanted to prevent that, you could use something like a CAPTCHA, or perhaps give each user a session and cool off period. You could also implement something called a proof of work system.

Build a Javascript Blockchain

Blockchain! It’s the mystical buzzword that every company is saying right now. At its core, the basic concept of blockchain is not hard to understand; it’s essentially a distributed linked list. It’s also used by the popular cryptocurrency called Bitcoin. The advantages of Blockchain is that it allows for a decentralized collection of data whose integrity is easily verifiable, and the data itself is immutable Keep in mind that a fully robust blockchain will also contain smart contracts, mining algorithms (proof of work/proof of stake) and other flavorful elements that you could enhance the chain with.

Multithreaded Javascript

For the longest time, Javascript has always been implemented using a single thread in your browser. For the most part, this wasn’t a problem. If you’re just using javascript for simple DOM manipulations or form submissions then a single thread is all you need. However, once developers started getting more advanced with their Javascript usage, this eventually led to an issue. Let’s say I have the following single page application (SPA) that shows a list of prime numbers from 1 to 600,000:

JavaScript Read USB

You can now officially use JavaScript to read USB devices that are connected to your computer. This is using the new WebUSB API that is still in early draft. As being so, the API could later change or be removed altogether until it receives the final verification. In order to use WebUSB you need to be running the latest version of Google Chrome, with the experimental web platform features flag enabled.

Snapchat using Javascript – Zuck.js

Stories! Stories are everywhere these days. Snapchat, Instagram, Facebook, Facebook Messenger and Whatsapp all have stories. Hell, it’s only a matter of time before Microsoft Excel gets a stories update.   In any case, if you want to build an app like Snapchat or build an app like Instagram, there is an easy way to do so. The focus of this tutorial will be about building the story functionality of Snapchat and Instagram into an app.

Reddit API Application only OAuth in Javascript

Before you begin developing your Reddit application, you will need to make sure that your app is authorized to access the Reddit API. Authorization is done through OAuth tokens that you receive from the Reddit server. The flow is pretty straightforward: Application Requests Token App Receives Token that’s valid for an hour App makes API calls with given token App request new token when the previous token expires For this tutorial, we are going to build a simple app that grabs the new posts from a subreddit.

JavaScript Read USB

You can now officially use JavaScript to read USB devices that are connected to your computer. This is using the new WebUSB API that is still in early draft. As being so, the API could later change or be removed altogether until it receives the final verification. In order to use WebUSB you need to be running the latest version of Google Chrome, with the experimental web platform features flag enabled.

JavaScript Callbacks

In Javascript, a callback function is a function that is passed into another function as an argument. This allows you to invoke that function with a return value. Remember, Javascript’s implementation within a browser is single threaded (well..until recently at least). That means that all of your code is executed within one linear operation. However, there are some functions in Javascript which are asynchronous. That means that they have the privilege to be invoked anywhere in that line of execution.