Cross-platform JavaScript game engine for web and smartphones