Implemented the basic ticking code for entities.