Rewrote the code, although player movement hasn't been implemented.