Actually I got it to work by adding a Do Loop like this and getting rid of the load bitmap and changing it to load image like this
SET DISPLAY MODE 640, 480, 32
HIDE MOUSE
SYNC ON
Sync Rate 30
`Load the source bitmap file
LOAD Image "media\F15.bmp", 1
Do
SPRITE 1,Screen Width()/2,Screen Height()/2,1
SYNC
Loop
END
I assume it was because it was only drawing it once until I put it in a loop. Now this code doesn't display the background
MAX = 20
DIM SpriteNum(MAX)
DIM SpriteX(MAX)
DIM SpriteY(MAX)
DIM DirX(MAX)
DIM DirY(MAX)
`Initialize the program
SET DISPLAY MODE 640,480,32
HIDE MOUSE
SYNC ON
`Load the sprite
LOAD BITMAP "plane2.bmp", 1
GET IMAGE 1,0,0,50,50
GET IMAGE 2,50,0,100,50
GET IMAGE 3,100,0,150,50
GET IMAGE 4,150,0,200,50
`initialize sprites
FOR N = 1 TO MAX
SpriteX(N) = RND(540)
SpriteY(N) = RND(380)
DirX(N) = RND(3) + 1
DirY(N) = RND(3) + 1
SpriteNum(N) = RND(3) + 1
SPRITE N, SpriteX(N), SpriteY(N), SpriteNum(N)
NEXT N
`Load background bitmap
LOAD BITMAP "background.bmp", 0
`This is the game loop
REPEAT
IF TIMER() > StartTime + 100
FOR N = 1 TO MAX
`move the sprites
SpriteX(N) = SpriteX(N) + DirX(N)
IF SpriteX(N) > 540
SpriteX(N) = 540
DirX(N) = -1
ENDIF
IF SpriteX(N) < 1
SpriteX(N) = 1
DirX(N) = 1
ENDIF
SpriteY(N) = SpriteY(N) + DirY(N)
IF SpriteY(N) > 380
SpriteY(N) = 380
DirY(N) = -1
ENDIF
IF SpriteY(N) < 1
SpriteY(N) = 1
DirY(N) = 1
ENDIF
`check for collision
IF SPRITE HIT(N,0) > 0
DirX(N) = DirX(N) * -1
DirY(N) = DirY(N) * -1
ENDIF
`draw the sprite
SPRITE N,SpriteX(N),SpriteY(N),SpriteNum(N)
NEXT N
SYNC
ENDIF
UNTIL MOUSECLICK() = 1
END
But if I change it to load Image... and then paste it in the loop it works like this
MAX = 10
DIM SpriteNum(MAX)
DIM SpriteX(MAX)
DIM SpriteY(MAX)
DIM DirX(MAX)
DIM DirY(MAX)
`Initialize the program
SET DISPLAY MODE 640,480,32
HIDE MOUSE
SYNC ON
Sync Rate 60
`Load the sprite
LOAD BITMAP "plane2.bmp", 1
GET IMAGE 1,0,0,50,50
GET IMAGE 2,50,0,100,50
GET IMAGE 3,100,0,150,50
GET IMAGE 4,150,0,200,50
`initialize sprites
FOR N = 1 TO MAX
SpriteX(N) = RND(540)
SpriteY(N) = RND(380)
DirX(N) = RND(3) + 1
DirY(N) = RND(3) + 1
SpriteNum(N) = RND(3) + 1
SPRITE N, SpriteX(N), SpriteY(N), SpriteNum(N)
NEXT N
`Load background bitmap
Set Current Bitmap 0
LOAD Image "background.bmp", 5
`This is the game loop
REPEAT
IF TIMER() > StartTime + 100
FOR N = 1 TO MAX
`move the sprites
SpriteX(N) = SpriteX(N) + DirX(N)
IF SpriteX(N) > 540
SpriteX(N) = 540
DirX(N) = -1
ENDIF
IF SpriteX(N) < 1
SpriteX(N) = 1
DirX(N) = 1
ENDIF
SpriteY(N) = SpriteY(N) + DirY(N)
IF SpriteY(N) > 380
SpriteY(N) = 380
DirY(N) = -1
ENDIF
IF SpriteY(N) < 1
SpriteY(N) = 1
DirY(N) = 1
ENDIF
`check for collision
IF SPRITE HIT(N,0) > 0
DirX(N) = DirX(N) * -1
DirY(N) = DirY(N) * -1
ENDIF
Paste Image 5,0,0
SPRITE N,SpriteX(N),SpriteY(N),SpriteNum(N)
NEXT N
SYNC
ENDIF
UNTIL MOUSECLICK() = 1
END
It works fine like this is there anything wrong with doing it this way? IF there isn't I'm just assuming it is just better to stay away from load bitmap command and also make sure your display command is in a loop.