changing the algorithm and refactoring

modified:   src/environment/blocks/Block.java
modified:   src/environment/room/Room.java