Hi! I am working on a SpriteKit project for macOS that involves using the WASD keys to move a sprite onscreen. An issue I'm having is that I cannot seem to detect two keys being pressed simultaneously, in order to create diagonal movement. For example, I'd like for W to move the sprite upwards, but W+D to move diagnally upwards in a 'northeast' direction. Currently, I'm overriding keyDown, but I undserstand that each individual key press is one event, so this won't really work. How would I efficiently detect multiple keys being pressed down? Thanks!
macOS SpriteKit Diagonal Sprite Movement
Add a Comment