Added player and entity logic.