javascript game base support class