Added collision detector. Refactoring. Scene generator