Monthly Archives: March 2016

Playing a Tiled Image as an Animation in JavaScript

The JavaScript code below, when run, prompts the user to specify an image file, that image’s size in frames, and the number of frames per second. When the “Play” button is clicked, the frames within the main image are displayed … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Detecting Collisions of Shapes in JavaScript

The JavaScript program below, when run, displays a wraparound playfield filled with squares moving in random directions at random speeds and rotating at random rates. When two squares overlap, the collisions between them are highlighted with small circles. The program … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment