Switch Case and Key Events
Hey. I had a small project for school not too long ago. I developed pong to the best of my abilities, but there was one major flaw. When someone tried to hold down w/s at the same time as up/down (to control the padels) they wouldn't be able to move both at the same time. This really interfered with game play. I had them in a switch case, but I'm not sure if this was the best way to go about it. So, tell me what you think. Here's my code for that portion:
left and right are padel objects. getX, getY, setX, and setY are pretty obvious.
public void keyPressed(KeyEvent e)