4 ms·
When you say JavaScript for games, presumably what you have in mind is ActionScript and Flash?
by Tichy 19y ago
When you say JavaScript for games, presumably what you have in mind is ActionScript and Flash?
- xirium 19y agoKnowledge 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.
- Tichy 19y agoAny 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?
- xirium 19y agoA 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.
- Tichy 19y agoI 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.