Hacker News new | ask | show | jobs
by xirium 6682 days ago
Firstly, skip all of the low-level, platform-specific details and learn JavaScript. This will give you all of the colours and performance that you require for sprite based games. I've seen a very good version of OutRun done in JavaScript. A 2D platformer can definitely be implemented. Also, if you implement in JavaScript then you'll also get a wide audience for your work without requiring anyone to install anything.

Secondly, a real-time game is a turn-based game where the turns occur in real-time. Unlike a strategy game, the computer continues even if you don't make a move. Imagine AD&D melee combat at 30 rounds per second. This doesn't require threading.

2 comments

I would say that JavaScript is not exactly the best language to learn for creating games. Aside from the Canvas tag there is no good way to do graphics with JavaScript (at least no simple way that isn't a bunch of arcane HTML tricks which wouldn't make any sense to a beginner).

And, if you're using the Canvas tag you're excluding IE users. If you're only going to reach a limited audience anyway, why not use Flash and reach a much bigger limited audience?

On the other hand, I guess Canvas teaches you about drawing to buffers, while Flash teaches you about more abstract things.

When you say JavaScript for games, presumably what you have in mind is ActionScript and Flash?
Knowledge of JavaScript is transferable to ActionScript but I was quite specific about the use of JavaScript. There's a large amount of code and documentation which is ideal for the task.
Any pointers? I have considered creating games in JavaScript (OK, arguably my boobs memory is a game in JavaScript), but I still would not consider it the obvious choice for action games. For a beginner, I would rather suggest something classical, where you have a screen/bitmap/whatever that you can draw to?
A good example to start would be BreakOut. You have a grid of tiles. Some are bricks. Some are spaces. This you can implement as an HTML <table>. The bat and the ball can be implemented as floating <div>s. You can detect the x position of the pointer and use this to control the position of the bat. When the ball hits a brick, you want the brick to disappear. If you label each tile in your grid then JavaScript can replace any tile with any other image.
I was just thinking in terms of the original poster. There are lots of books and articles on writing "normal" games (game loop, sprites etc.). I think Javascript games would be a bit different, so I don't think they would be a good starting point. Unless you think that in the future there will only be Javascript games. For the time being, it would be much harder work to make a Javascript game look reasonably smooth, compared to other technologies.