JavaScript game engine with component based architecture