Learning a bit of javascript for gaming