First, we will create a new method called
If KeyDown(KEY_UP) Then 'check if UP key is pressed pY -= 5.0 'subtract 5 pixel from Y position
As the paddle should stop at the top, we check if its Y position is less than 25 pixels away (paddle height is equal to 50 pixel) and set its Y position back to 25 pixels.
If pY < 25.0 Then pY = 25.0 'Check against top wall Endif:Now we check if the DOWN key is pressed and move the paddle accordingly. Again, we check if ...