Almost all games needs to record certain information about the player progression. For example, you may want to have a local leaderboard to track the player best results of each round, or the story progression, or the name of the player, etc. Sometimes is interesting to record these kind of information even after the user closes the browser and turn off the computer, thus, the next time a user comes back to your game, the progression is saved there.

HTML5 provides a feature for this kind of offline storage, called Local Storage. The concept is similar to cookies: you have a key-value storage system and you can write or read information locally with it. It is really basic, all you have to do is:

localStorage['key'] = 'value'

and you have an information stored in the user computer. The user can close the browser and turn off the computer but when he or she opens you game again, the information ‘key = value’ is still there.

The problem is when the browser does not support the HTML5 Storage feature. When this is the case, you need to use a third party library for offline storage, store the information into some server, or don’t save the information at all. The third option is the easier (if storing information is not essential), because you don’t have to change all your code, just define a stub localStorage object and the life goes on.

A beautiful way to detect if browser supports localStorage or any other HTML5 feature is using the Modernizr library. Thus, you can add the following verification to your code:

if (!Modernizr.localstorage) {
    window.localStorage = {};
}

Take a look at http://html5demos.com/storage to see an example.

Read more

Alan Wake

I know a lot of good programmers that want to develop games, but don’t go forward because they don’t know any artist and lack the skills to make something beautiful. For a while, I also complained about that. I am a skilled programmer, but I ain’t an artist, what should I do?

My answer for you is: stop whining and deal with it! Yes, you don’t need the artistic skill to create a copy of Bioshock Infinite, or the wonderful atmosphere of Alan Wake. You need, most of cases, simple graphics. You may want to create a ultra beautiful game with painted sprites that even Picasso would be proud, but you probably won’t. Recognize your limitations and adjust your game to what you can do. Go for simple graphics and work hard in the gameplay and other aspects of the game.

Following, I will give some tips to create you game art. I’m not a Picasso myself, but I can handle the basics. I hope I can help you in this process.

Know Your Tools

Before starting to draw something, you need to know what tools you will use, but remember that a tool itself doesn’t do anything, you do. Personally, I like vector graphics, for this I use Inkscape, but you can use Corel Draw, Illustrator or many other tools like them. You may like pixel art or 3D models – you can use GIMP, Blender, or even MS Paint – just choose the tool you feel more comfortable with and learn the basics.

For the final touches, I use GIMP. You can use Photoshop, Z Brush or any other tool related to your style of art. Again, just pick one and go through it.

Follow Tutorials

With your tools ready, go for tutorials. There is a lot of them around the internet, a simple search can reveal several great how to’s. I recommend you follow sites and blogs with general tutorials, such the 2D Game Art For Programmers and Tutplus, also take a look on Devian Art and other artistic forums where people create a lot of tutorials.

Do it for specific things too, for example, if you want to draw a simple sword for you game, take a look on google, you will find a lot of things, e.g.:

Use References

When you have a certain skill with your tools, go for references. Search images of real things, line drawing things, clip arts, etc. You don’t have to create everything from zero. For example, if you want to draw a hand, take a picture of your own hand, search for images of hands on google or use reference such this one:

Hand Reference Sheet by Ultimate Iron Giant (http://ultimateirongiant.com)

Hand Reference Sheet by Ultimate Iron Giant (http://ultimateirongiant.com)

Learn With The Bests

When you see a game or a cartoon, pay attention to details. For example, cartoons usually have large borders, ridiculous proportions, fast movements, caricatured expressions, simple forms, poor shadows, just like the Dexter Laboratory. The Samurai Jack is other example, but now without any border, which makes it special among other Cartoon Network’s programs.

cartoons
Pay For It

If you are too lazy to learn new tools or can’t spend any time to do it, or even simply don’t want to, your solution is: pay for it! There is a lot of freelancer sites and forums where you can find artists and pay their prices.

Read more

I created a new repository in Github with my personal boilerplate to CreateJS. This boilerplate includes:

  • A simple server written in Python using the Flask web framework, you will need them to run the server;
  • A simple html page initializing the CreateJS libraries and jQuery;
  • The last release of jQuery;
  • A folder structure containing: assets, core, data, models, scenes, and systems;
  • Core files containing some useful objects for your games;

I will keep these files updated as much as I can.

For those who don’t know, a boilerplate is a “template project” that you can use to start a new work. The template includes files, folders and the structure of the project. If you are happy user of Sublime Text, you can install the Nettuts + Fetch plugin to add this (or other ones) boilerplate automatically.

You can access the repository and propose changes, access:

https://github.com/renatopp/createjs-boilerplate

Read more

In my opinion, knowing the tools you work and knowing how to set them up to operate together is an important step to keep yourself productive, efficient and mentally healthy =). In this post I will talk a little bit about the tools I am currently using to develop my games.

I’m sharing the essential items of toolbelt and I hope some of the programs I cite here can be useful for you. Notice that, all tools of this list can be used in any OS, such as Windows, Linux and Mac.

Programming Tools

As a programmer, I think the core of my work tools is Sublime Text 3, a powerful, beautiful, fast, elegant, awesome, demigod editor that I use to write code, texts, notes, and anything else. Sublime has several built-in addictive features that make you love the editor, such as the multi selection, the distraction free mode, the command palette and the plugin system. Sublime Text 3 costs USD $70, however, it is free for evaluation (you will see a notification to buy it, occasionally, but it is far from being a problem).

With Package Control, you can easily add new plugins to Sublime, just press ctrl+shift+p to open the command palette, chose the install package option and select the plugin you want to install. My must-have plugins:

  • Dictionaries: it adds a lot of dictionaries (press F6 to use the spell check). This package is pretty useful for people who write common texts, documentation, code comments, in English or other 28 languages. In fact, I am writing this post in Sublime right now and using this plugin.
  • Nettuts + Fetch: an awesome plugin that let you add remote files or complete boilerplates to your project folder. Just press ctrl+shift+p to open the command palette, type “fetch” and select the target file or package you want and they will be automatically added to your project. It is highly recommended, specially if you have a common structure that you use in several projects. It is also useful to add common libraries automatically, such as jQuery or normalize.css.
  • Sidebar Enhancements: adds a lot of options to the sidebar menu (when you press the right mouse button on sidebar files or folder). With this plugin you can delete, open, run and copy files and folder, and much more. It is a must have that can be useful for all cases.

I use the default theme, Monokai, which can be seen at the image below, but you can add more themes with package control. I made just a few changes on the default configuration: I have added two rulers lines to the columns 0 and 80, and set the translation of tabs to spaces to true.

Sublime Text 3 - Screenshot

I am a Python guy, and I use this language to help me in practically any project or task that I do, such as to create a simple web server to run my CreateJS projects. I am using Python 2.7 provided by Anaconda. Anaconda is a super package for scientific computing which includes a python distribution within a lot of useful libraries, such as Numpy, Scipy, Matplotlib, and Flask.

Flask is a Python micro-framework for web development that I use to create simple web servers when I need one. This is the case for several HTML5 game engines, such as the CreateJS. For example, you can create a basic web server with this:

from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route("/")
def index():
    return render_template('index.html')
if __name__ == "__main__":
    app.run(debug=True, port=5051)

Image Editing

For image editing I basically use Inkscape and Gimp, two powerful open source programs that some people may hate, but I love them.

Inkscape is a vector graphics editor similar to Corel Draw or Illustrator, and uses the Scalable Vector Graphics (SVG) format natively. Inkscape has a lot of features and an intuitive interface, great for noobies and pros.

GIMP is an image editor that replaces the Photoshop. With GIMP you can use plugins, brushes, patterns and other components that were originally destined to Photoshop, without spend any money. It is constantly updated by community and also has a lot of features and an intuitive interface.

Audio Editing

At this moment, I don’t have any tool for create musics or sound effects, but for general audio edition I use Audacity. I can’t really say anything about Audacity because I rarely use it and when I do, it is just for simple tasks.

Other Tools

Git is my choice of version control system. It is easy to use and hard to messing things up. I use Github to host my open projects and Bitbucket for my private ones.

Dropbox is essential, sometimes I use three different computers and I don’t want to sync my code with Git before I finish some feature of fix some bug. All my projects are in the dropbox folder, thus, I can save a file in my Desktop and open it in my Notebook without any effort from my part.

Finally, I use Firefox and Chrome to test my web games. I don’t really care about IE.

Read more

CreateJS Logo

CreateJS is a great suite of modular libraries and tools to make HTML5 games and other interactive applications. In the core of CreateJS, there is 4 libraries: EaselJS, SoundJS, PreloadJS, and TweenJS. These libraries are completely independent, i.e., they can be used isolated or even with other game libraries.

EaselJS is the main component of CreateJS. EaselJS controls the game loop, the event manager, the hierarchical organization of objects and the rendering system. It works above the canvas element, thus, providing an easy interface to draw shapes and bitmaps.

SoundJS provides a consistent API to use audio in different browsers. It works via plugins which abstract the actual audio implementation, so playback is possible on any platform without specific knowledge of what mechanisms are necessary to play sounds.

PreloadJS is used to preload all assets to your game, such as images, sounds, data, etc. It provides a complete API with an event system so you can track the loading progress and the connection fails.

TweenJS provides tween function for animations. It can be used independently and provide a simple but complete API to track tweening of object properties and chained commands.

Together with these four libraries, the CreateJS suite also comprises a set of tools to aid the game development process, from applications for exporting SWF animations to EaselJS spritesheets to code completion for editors.

Checkout the video below by the creator of CreateJS to have a better overview of what CreateJS is capable of.

Read more