Pygame Making A Sprite Face The Mouse
问题 Im New To Pygame But Kinda OK On Python, Im Creating A Zombie Shooting Game With an overhead view. I managed to make the character move when pressing the arrow keys. But now i need to get the player to FACE the mouse/cursor without clicking the screen all the time. Any Help? 回答1: for event in pygame.event.get(): if event.type == MOUSEMOTION: mousex, mousey = event.pos # build a vector between player position and mouse position moveVector = (mousex-playerx, mousey-playery) """ compute the