Added collision detection code and modified sprite classes