Javascript-based simulation game with collision detection and patfinding