Back then, most JavaScript usage I saw was just for something simple such as bookmark or pop up window. There weren’t many fancy examples but this is not true nowadays. Two years had pass since I heard about Ajax from a friend, I finally decide to spend some time on JavaScript.
Both JavaScript and ActionScript are based on ECMAScript which means they share identical syntax. So, I don’t really have a hard time to understand the basic of JavaScript.
For me, the best way to learn is to get my hands dirty instead of reading tons of text and did nothing. I manage did a simple Pong game even though my knowledge on JavaScript is limited.The game can be view at this page.
Pong (marketed as PONG) is one of the earliest arcade video games, and is a tennis sports game featuring simple two-dimensional graphics – wiki
Flash game is usually loop with an onEnterFrame event. But there aren’t any “frames” in JavaScript, so we will need to construct the game loop by using a setInterval() method. Both JavaScript and ActionScript’s setInterval is similar, which execute code periodically.
Of course this little game experiment I did doesn’t really show the power of what JavaScript could do. So, navigate to Google’s Chrome Experiments and have a look at some great experiments did by other PROgrammers.
View JavaScript Pong Game
pong.js 2.69KB
Besides writing your script from scratch, you could also utilize JavaScript framework which will ease your development process. Below are some of the many JavaScript frameworks available.
JQuery
MooTools
YUI
Prototype
Nice graphics! I was just coding one myself with html5 audio in it.
http://barrydegraaff.tk/pong/
Cheers Barry