Capture the flag game in HTML5 Javascript