Hacker News new | ask | show | jobs
by Tichy 6682 days ago
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?
1 comments

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.