Games development in JavaScript: Canvas vs DOM benchmark




Canvas vs DOM animations performance test

In my last article I described four frameworks used in games’ developing. What differentiate frameworks is the way in which they render graphic. Each framework I mentioned used DOM and CSS, only one enabled the use of Canvas too. But it’s obvious that in time more and more frameworks will work with it – it’s just still a developing standard.

During writing the previous article, I went in for comparing a performance of Canvas and DOM. It’s known that those are two completely different technologies with different capacities. HTML presents data, CSS gives them an appearance, Canvas draws. So I wondered how to compare them since they are so different.

As the result of my observation I decided that that the most important and the hardest thing is to animate many objects simultaneously (eg. missiles, enemies, obstacles). At the outset I strongly simplified a game model  to moving squares. Afterwards I was testing different variants achieved with CSS.  So I didn’t test anything what wouldn’t be feasible in CSS – it’s clear that Canvas would be better there (I mean such capacities as drawing diagonal lines or polygons).

Read entire post »


Add to Del.cio.us

RSS Feed

Add to Technorati Favorites

Stumble It!


Digg It!

        www.sajithmr.com

Unit Testing in JavaScript: JSSpec


If you are not familiar with definition of Unit Testing or you are wondering about solutions in JavaScript go to one of my previous articles.

If you want to see real example of Unit Testing or Test Driven Development, go to article Unit Testing in JavaScript: QUnit.

Today’s Unit Testing Framework is JSSpec. It is used by MooTools, TiddlyWiki and others.  Because it is purely JavaScript (Browser-side) tool like QUnit, which have been already described I’m going to point out only important things, without going into details.

Read entire post »


Add to Del.cio.us

RSS Feed

Add to Technorati Favorites

Stumble It!


Digg It!

        www.sajithmr.com

Unit Testing in JavaScript. QUnit


If you are not familiar with definition of Unit Testing or you are wondering about solutions in JavaScript go to one of my previous articles.

The first type of JavaScript unit test frameworks are solutions like JSSpec or QUnit. They are written entirely in JavaScript and require a browser to run . The undoubted advantage of these solutions is an amazing simplicity of writing tests. But if we want them to run in different browsers, we are forced to do it manually. Unfortunately without some tricks we can’t run them from console, nor at once in different browsers or computers. However, there are adapters that let you to extend their functionality. Famed examples are JsTestDriver, Test Swarm and Selenium. Thanks to them we are able to control multiple browsers on multiple computers from one place. Anyway, I will describe them in future. Today we’ll take care of the basics.

Read entire post »


Add to Del.cio.us

RSS Feed

Add to Technorati Favorites

Stumble It!


Digg It!

        www.sajithmr.com

Games development in JavaScript: part 1 – frameworks


What is the point of making games in JavaScript? you may ask and it’s a good question. Everybody knows that since the web’s begining Flash had better ability to become a base technology for games development. But times change. Javascript is gaining two types of allies – such technologies as Canvas, CSS3
or SVG and much better performance of browsers engines. Brett Fattori, Render Engine frameworks author, wrote:

I realize that some people will question my motives, considering that Adobe Flash is available and offers more capability than Javascript does (at this point), however, the entry fee is fairly steep for most individuals. The Render Engine is targeted at those individuals who would like to create games but who don’t have access to Flash, don’t want to pirate Flash and risk their future, or don’t have the skills necessary to create games with it.

What is more, Flash is closed technology managed by only one company. It needs plugin which isn’t available for every

single device. That’s what makes JavaScript and connected technologies an interesting alternative for the Flash. Also when we talk about games.

Read entire post »


Add to Del.cio.us

RSS Feed

Add to Technorati Favorites

Stumble It!


Digg It!

        www.sajithmr.com

Unit Testing in JavaScript. Introduction


JavaScript is mainly (but not only!) clientside language. Therefore it poses some problems for developers who use unit testing in their projects. I’m going to point out most of them and solve bit by bit in next articles. If you don’t need explanation of this term itself, proceed right to the JavaScript Issues title.

Unit Testing

In short: We’re writing tests for our application which are independent of each other. We may quickly execute set of them as we modify the code. The new application is error-free if all go positively.

Unit Testing is connected with Agile methodology and techniques of producing a software such as Extreme Programming (XP) or Test-driven development (TDD). They assume that changes in application should be made frequently and in small portions. Unfortunately, it’s equivalent to frequent errors. Thanks to Unit Testing we are able to detect them rapidly.

Read entire post »


Add to Del.cio.us

RSS Feed

Add to Technorati Favorites

Stumble It!


Digg It!

        www.sajithmr.com