Hi Josh
I've had a look through your code, there are a number of issue.
1: Use the "randomize" and "timer()" commands at the start of your code to get randomize values when using the "rnd" command, else you'll get the same set of numbers each time the program runs. (have a look at the example given in the help file for "rnd", run it a couple of times then take out the line "randomize timer()" run that a couple of times and see what happens).
This effects the starting position and speed of the ball.
2: You put "sync on" a the start of the program but then did not put a "sync command at the end of the main loop to refresh the screen. This meant that the screen was black.
3: You weren't calling the "sprite" command once the positions had been changed so the sprites will not move on the screen. All the times you were using the "sprite" command before the main loop were unnecessary.
4: The y coordinate system when in 2D is that zero on the Y axis is at the top of the screen and larger values of Y will be toward the bottom of the screen. So to get the ball to drop from the top of the screen to the bottom of the screen, the starting coordinate should be zero or less (a negative value will mean the sprite is off the top of the screen) and the spreed should be a positive number so in the loop the code would be:
(y position) = (y position) + (speed in y direction)
I tend to print position and speed to the screen when I'm developing a program to give me an idea of what's going on, it can give a hint if things are moving in the wrong direction or if they've left the screen.
Another tip is to the use the "screen widht()" and "screen height()" commands to get the size of the screen.
5: The other thing, that I've only just discover" is that even with the sprite hidden, it will still register a hit when the hidden sprite hits another sprite.
6: Another thing I noticed was that you had different images for each player sprite but then only used the one image for all four sprites. Without seeing the files, I don't know if the players were all meant to be different or the same.
I've gone through the code and edited it to get something to work. It's not perfect but you can control the players, the balls drops, hits are registered and when the ball goes off the bottom of the screen it will be positioned at the top, at a random x coordinate with a random speed. I've not used any external media but programmed some simple sprite into the code so you can run it as is.
`Variables for moving the players
playersleft=4
DIM PlayersNum(1)
DIM PlayersX(4)
DIM PlayersY(4)
`Variables for moving the ball
DIM BallSN(1)
DIM BallX(1)
DIM BallY(1)
DIM BallSpeed(1)
HIDE mouse
SYNC ON
sync rate 60 :`add frame rate speed
randomize timer() :`use the "randomize" and "timer()" commands will give random output from the "rnd"
`lines 21 to 36 create images and sprites in place of external media
`create a bit map for the players and balls
create bitmap 1, 50,50
set current bitmap 1
`sprite 1 - players (red boxes)
ink rgb(250,0,0),0
box 0,0,50,50
get image 1,0,0,50,50
`sprite 2 - ball (green box)
ink rgb(0,250,0),0
box 0,0,50,50
get image 2,0,0,30,30
set current bitmap :`set the bitmap back to the screen
PlayersX(1)=50
PlayersY(1)=350
PlayersNum(1)=1
PlayersX(2)=150
PlayersY(2)=350
PlayersNum(1)=1
PlayersX(3)=300
PlayersY(3)=350
PlayersNum(1)=1
PlayersX(4)=450
PlayersY(4)=350
PlayersNum(1)=1
BallSN(1)=2
BallX(1)=RND(540)
BallY(1)=1
BallSpeed(1)=RND(9)+1
REPEAT
IF UPKEY()=1
`move the sprite up
PlayersY(1)=PlayersY(1)-4
PlayersY(2)=PlayersY(2)-4
PlayersY(3)=PlayersY(3)-4
PlayersY(4)=PlayersY(4)-4
IF PlayersY(1)<1
PlayersY(1)=1
ENDIF
ENDIF
IF DOWNKEY()=1
`move the sprite DOWN
PlayersY(1)=PlayersY(1)+4
PlayersY(2)=PlayersY(2)+4
PlayersY(3)=PlayersY(3)+4
PlayersY(4)=PlayersY(4)+4
IF PlayersY(1)>420
PlayersY(1)=420
ENDIF
ENDIF
IF LEFTKEY()=1
`move the sprite left
PlayersX(1)=PlayersX(1)-4
PlayersX(2)=PlayersX(2)-4
PlayersX(3)=PlayersX(3)-4
PlayersX(4)=PlayersX(4)-4
IF PlayersX(1)<1
PlayersX(1)=1
ENDIF
ENDIF
IF RIGHTKEY()=1
`move the sprite right
PlayersX(1)=PlayersX(1)+4
PlayersX(2)=PlayersX(2)+4
PlayersX(3)=PlayersX(3)+4
PlayersX(4)=PlayersX(4)+4
IF PlayersY(1)>590
PlayersY(1)=590
ENDIF
ENDIF
BallY(1) = BallY(1) + BallSpeed(1)
IF BallY(1) > screen height()
BallY(1)=-30
BallX(1)=RND(590)
BallSpeed(1)=RND(9)+1
ENDIF
`position sprites
SPRITE 1, PlayersX(1), PlayersY(1), PlayersNum(1)
SPRITE 2, PlayersX(2), PlayersY(2), PlayersNum(1)
SPRITE 3, PlayersX(3), PlayersY(3), PlayersNum(1)
SPRITE 4, PlayersX(4), PlayersY(4), PlayersNum(1)
SPRITE 5, BallX(1), BallY(1), BallSN(1)
`the collision detecting has been changed and put in a for to next loop
for i = 1 to 4
IF SPRITE HIT(i,5)=1
hide sprite i
`reposition the sprite so it's completely out of the way.
PlayersX(i) = -1000
PlayersY(i) = -1000
playersleft=playersleft-1
ENDIF
next 4
`print the ball variables to the screen so you can see what's going on
set cursor 0,0
Print "BallY(1) : ", BallY(1)
Print "BallX(1) : ", BallX(1)
Print "BallSpeed(1) : ", BallSpeed(1)
`refresh the screen
sync
UNTIL playersleft <= 0
End
The main issue is that when the player's hit the boundary, you're only restricting the first sprite inside the boundary but not the other three so they will move off the screen. There are some other things that could be done better but I'll give you a chance to work these things out for yourself.
Anyway, I hope this gets you some of the way to sorting out your game.