My student is trying to change the code so if sprite named kid1 goes up, then the ball should not go right but stay left. Is this possible?
Do you mean if sprite1 kid goes up, the ball should stand still? If yes, the question itself almost breaks down the problem and solution:
- If kid1 goes up = (if up key is pressed)
- stop the ball = ball.velocityX = 0 (you could also place the ball after it has stopped with sprite.x=__)
Not sure this answers your question though. The goal of the game is not clear to me:) Try breaking down each step of the game and seeing if you can match code to accomplish each step. If you get stuck, let us know.