initial translation of player.py to java