-1
\$\begingroup\$

I just stumbled on this library/language called Coffescript, and thought it would do the coding part so much easier.

As an example, drawing maps with a for loop would be:

map = [0, 0, 0, 0, 0]

drawTile = (tile, tx = tile * ts, ty = 0) -> c.drawImage(tile, tx, ty)
drawTile tile for tile, i in map

Translates to this:

var drawTile, i, tile, _i, _len;

drawTile = function(tile, tx, ty) {
  if (tx == null) {
    tx = tile * ts;
  }
  if (ty == null) {
    ty = 0;
  }
  return c.drawImage(tile, tx, ty);
};

for (i = _i = 0, _len = map.length; _i < _len; i = ++_i) {
  tile = map[i];
  drawTile(tile);
}

I've only had an hour to look at this, but sofar I think its beautiful. My question is how would this fit into HTML5 game development? Could there be any problems using this that I don't see?

I know the code above is useless in a real game, but I haven't figured out loops yet.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ There's no such thing as any inherent problem in using X language for development. They may have certain quirks you have to deal with (try debugging in PHP for example) but as you use a language you learn the best ways to work with it. \$\endgroup\$
    – Mike Cluck
    Jul 22, 2012 at 12:53

1 Answer 1

1
\$\begingroup\$

No, there is no problem in using CoffeeScript, if you really want to (I like this language, too). Everything that runs in Javascript runs just as well in Coffeescript.

The only issue you could have is with debugging. The only way to debug is to look into the Javascript code, which is not the code you produced. But if you can handle that, go ahead.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .