So I decided to try and make a single player pong program but ran into an issue. I'm using a repeat loop to have the ball move across the screen, which works fine, but when I try to move the line up and down (for the ball to bounce of off) it doesn't work. Is this because getKey gets reset when the loop ends, or is there some other issue I'm missing?
2→A //height of the line
0→X //X-coor of the ball
0→Y //Y-coor of the ball
-1→S //direction of the ball (left/right)
.1→T //direction of the ball (up/down)
Line(-15, A, -15, A-4
Repeat X=-16
Pt-Off(X, Y, 3
X+S→X
Y+T→Y
Pt-On(X,Ans,3
Line(-15, A, -15, A-4, 20
min(10, max(-6, A+sum(ΔList(getKey={34, 25→A //got the idea for this from the wiki's movement page, makes sure the line doesn't go off the screen
Line(-15, A, -15, A-4
If X=15 or X=-15 and Y≤A and Y≥A-4
-S→S
If Y=10 or Y=-10
-T→T
End
Text(10, 10, "YOU LOSE! :(