Tag Archives: beginner

Review “Learning 2D Game Development with Unity: A Hands-On Guide to Game Creation”

I’ve just finished reading Learning 2D Game Development with Unity: A Hands-On Guide to Game Creation, and I really enjoyed it despite many issues with the actual text (I’ll try to cover everything here). I’m just starting to learn Unity3D for 2D game development, so I’ve only watched a few of the official videos and followed a few tutorials online (the best so far being from pixelnest.io). After reading this book, I felt way more competent at creating my own game than with tutorials I’ve done elsewhere.

That’s not to say there aren’t some problems with the actual book contents. Quite a few people also have had problems with the book based on the Amazon reviews. I think the greatest comment, and a sentiment I share, is that the book could benefit from a technical edit. I’m a professional software developer, and I struggled to follow what was going on at one point.

This leads me to a major issue I had with the book, dropping a star from my review: Chapter 7 (Setting up Player Physics and Colliders) belongs before Chapter 5 (The Basics of Movement and Player Control). I don’t know how something like this could have been missed, but there’s no excuse for a ‘follow along’ book to be anything but sequential in its content. I’ve self-published a programming book, so I know getting things in the correct order while writing and editing is difficult. I also know that it’s unlikely for an editor or even a technical reviewer to catch this (you literally have to be ‘following along’ to encounter this problem). I toyed with giving the book 4 stars because I loved the content so much, then I thought about how well presented other books I’ve given 4 star reviews are and this book isn’t presented at the same level. If you take my advice and read Chapter 7 before Chapter 5, you’ll have almost no problem with this book. I went through the entire book in about two weeks using Unity 5.

This leads me to another problem which reduced my review by a ½ star: Chapter 14 is incomplete. Chapter 14 covers a then-beta feature of UGUI control layout and interaction. Unfortunately, there is only a single page between adding your first element (a Mask) to the canvas and the end of the book. Had the book just ended there, I would have thought, “OK, that was very high level,” and probably shrugged off the last chapter. The summary of Chapter 14 says “We gave a brief overview of building a simple Options menu with some text elements, buttons, and graphics” and almost none of this was even covered in the chapter (possibly because I’m reading the ebook?). Again, this seems like it would have been caught with a good technical or even a copy edit.

Another 1½ stars get deducted for what others have emphasized as a general feeling of being ‘all over the place’ with the instructions. There are a few times where numbered lists go from selecting a GameObject and doing nothing to modifying some other GameObject and selecting the first GameObject, which then gets modified. I actually found some humor in this, because it reminds me of peer programming with an extremely caffeinated coworker. I couldn’t ignore this in the review, though, because it happened more than once. For another example, the ‘Creating Components’ section of Chapter 2 explains the steps for creating components in what read like commands (but are statements) and the following section defines the actual steps. If someone was to follow the command-like steps (not in list form) of the one section, then the actual command steps (in list form) of the following section, this would become very confusing.

I experienced a general feeling of the book being ‘all over the place’ through Chapter 4. This was where I realized that the end-of-chapter ‘Exercises’ were actually continuations of the chapter content. I’ve literally never read a book where an ‘Exercises’ section wasn’t supplemental content to further your understanding of the material within the chapter. Rather than an ‘Exercises’ section, this book really should have just labeled the section appropriately. DON’T SKIP EXERCISES or you’ll be skipping part of the content.

I will say that other reviewers on Amazon have had unnecessary problems with downloading companion code. The code is very clearly linked on the book’s preface and from the InformIT product page. Even if you were to purchase the book from Amazon or somewhere else, I don’t know where else you’d look for companion content than in the preface.

Please don’t read my review as negative, I’m only trying to point out the issues I’ve found with the book. If you follow all of the exercises, read Chapter 7 before Chapter 5, and pay attention to what you’re reading (some of the examples in the book have incorrect code which have been fixed in the companion content’s project files for the chapter), you’ll really enjoy this book. I enjoyed making the example 2D platformer throughout the book. I didn’t hate or dislike the book, but I also don’t think beginners should have to piece together the contents of a book just to ‘follow along’. All of this stuff could easily be resolved with an updated (and well edited) copy of the book.

One of the things I really enjoyed about this book is how options are explained concisely in a single place. This made me feel way more familiar with the Unity editor and the options for game components. While watching some of the official videos on Unity’s site, I felt like the speaker was moving way too quickly for most people to follow along in the editor while explaining very little about what every option meant. Many tutorials I’ve seen online explain the steps to make a simple game (often lacking sound effects, particle effects, or even most of Physics2D). This book does an excellent job of explaining the basics of everything used to make a 2D platformer game. In fact, if it wasn’t for the editing issues I mentioned earlier, I would have given this book 4.5 or 5 stars. It’s meant for beginners, and I feel like non-programmers and programmers can all easily digest the material.

I made a list of many mistakes I found while reading this book. I’ll be emailing the authors the list, so hopefully the addenda will be updated. I’d love to see the book updated for Unity 5.

Ratings Summary

Overall: ★★★☆☆ (3 stars)

Editing: ★★★☆☆ (3 stars)
Not ‘poorly’ edited, but very close. A lot of the mistakes could have easily been caught by having any non-technical reader proofread the contents.
Presentation: ★★★☆☆ (3 stars)
I gave three stars for presentation because there are some code snippets in the book that just won’t work. I’m not talking about issues like Unity 5 doesn’t have this.rigidbody2D anymore, so you need to create a private variable and gain a reference in the Start or Awake function. I’m talking about things like the EnemyController’s Flip method flipping the instance and invoking flip on a colliding enemy instance, causing the two operations to cancel out. Then, there’s the issue of at least one image, Physics2D configuration, not matching the text in which the text says Player-Player is unchecked while the image shows Player-Enemy unchecked (using image settings makes your player invincible).
Material: ★★★★☆ (4 stars)
I enjoyed the material. Best of many tutorials I’ve followed. I give 4 stars because the book is very basic (it’s for beginners), yet doesn’t exactly introduce best practices. For example, the basic platformer developed in this game creates a single level in which 1×1 components are used for the scene’s map. There’s no mention of performant alternatives like using Tiled and Tiled2Unity to create a single mesh map. This *could* be because Tiled2Unity wasn’t out at the time of the writing, but I’d expect at least the acknowledgement of the performance limitations.
Enjoyment: ★★★★☆ (4 stars)
I thoroughly enjoyed the book. With my notes about following exercises and reading Chapter 7 before Chapter 5, I would recommend for beginners to read this book. One last caveat: if code in the book doesn’t seem to ‘work right’, try the code on the author’s companion site.


Your First App: Node.js is complete!

I’m stoked to announce that I’ve finished writing my first self-published book, Your First App: node.js.

The book is a full-stack application development tutorial using what is commonly known as the ‘MEAN’ stack, but with a heavier focus on the backend technologies: node.js, express.js, and MongoDB. The book ends with a starter AngularJS project of an HTML5 instant messaging chat application.

While following along in the book, it may be useful to run test queries in a REST client. Postman is available for Google Chrome as a packaged application. Import `yfa-nodejs.postman_dump.json` (located in the root of the supplemental code’s repository) into Postman to evaluate the application’s API.

Check out the code on GitHub

What is node.js?

I’ve recently decided to write a book about node.js. I don’t feel like a lot of books out there (on any technology) cover real-world scenarios. Most of them are introductions to languages or deep-dives into a single aspect of a language or technology. There are very few books that cover real-world application development scenarios to include things like process, build, sample application, and deployment. A good example of the type of book I’d like to write is Agile Web Development with Rails.

Below is an excerpt from one of the first chapters of the book. This is *very* rough draft, but I thought I would share because it may be useful for anyone beginning in node.js development.

What is node.js?

Node.js is a server-side JavaScript environment which provides evented asynchronous I/O and a minimalistic set of core features. In the beginning, node.js combined v8 with libev. Unfortunately, libev is an evented I/O library for Unix-based systems only. Eventually, libev was replaced with a higher-level abstraction library called libuv which allows node.js to run on Unix-based systems and Windows. In 2011, Microsoft began contributing to node.js to bring it to the Windows platform. More recently, libuv removed libev as a dependency.

The key concept for node.js is evented I/O (mostly network-based) operations. This is handled via an event loop. Although understanding the implementation details of event loops can be pretty complicated, the idea is fairly simple. Let’s analogize.

Try to think about an application as a fast food restaurant. A cashier is patiently waiting at the register. A customer walks up to the register and places an order. The cashier hands the order off to the kitchen and maybe fulfills the customer’s drink order before returning to the register. Another customer arrives and places an order, initiating the same scenario as before. A third customer is walking to the register, but just before the customer reaches the register a cook dings a bell and the cashier steps away to grab the first order and hand it to the customer. The cashier then begins taking the third customer’s order. Midway through the order, the second customer’s order is ready. Because the cashier is not rude (maybe this is in Canada?), the third order must be completed before the second customer’s order can be handed back to the customer. But, the cashier can easily hand over the second customer’s order before filling the third customer’s drink order. Eventually, the third customer’s order is fulfilled and there are no more customers. The cashier waits patiently.

It may sound strange, but the above scenario is a simplification of an event loop. We see things like this every day. New node.js developers seem to have a hard time either understanding the event loop or understanding where it comes from. Take the following example, for instance:

function main(){
  console.log("Hello, world!");


There’s a little more going on in this example than the standard obligatory printing of “Hello, world!” I’ve wrapped the output line in a function called main and subsequently called that function. If you run this file, you’ll see that it prints out “Hello, world!” and exits. There is no event loop because we haven’t told the runtime to listen to or emit any events.

There are a couple ways we can initiate an event loop. Possibly the easiest way to visualize this is to use the standard JavaScript setInterval function to cause our application to write out “Hello, world!” every 250ms. To kill this application, you’d need to press Control-c.

function main(){
  console.log("Hello, world!");

setInterval(main, 250);

The above example is technically an event loop, although there aren’t really any events going on other than the setInterval function. Another way to initiate an event loop is to bind to or set up any event which interacts in some way with a file handle. In Unix, nearly everything is considered a file, so this would mean binding to a socket, file descriptor, or even screen input:

// respond to the SIGINT event
process.on('SIGINT', function(){
    process.stdout.write('\nHandling SIGINT event!\n');
    // cleanly exit with non-error status

// listen to events on standard input
process.stdin.on('data', function(chunk) {
  process.stdout.write('Hello, world!\n');

// Start reading from stdin so we don't exit.
console.log('Type anything and press ENTER...');

In the above example, process.stdin.resume() causes node.js to continually monitor the readable standard input stream for data. Binding a listener to watch for ‘SIGINT’ does not cause node to create an event loop on its own. Play around with this last example to get an idea of how the event loop works. If you’re interested in how libuv creates and maintains an event loop, there is a free uvbook available which dives into the internals of libuv.