Ok what I am trying to do is when the ball moves around and hits the blocks they disappear after all the blocks have left they will be redrawn to new locations and then you would have to do the same thing over again. so far I can get the first set of blocks to disappear but as soon as I hit a block it moves the blocks to their new locations.
REMSTART
Author: Kyle McWhorter
Date: 2/25/07
Purpose: move the ball around to hit the blocks after all blocks are gone redraw blocks in different position
REMEND
CLS
SYNC ON
SYNC RATE 40
HIDE MOUSE
`Set background
INK RGB(244, 214, 210), 1
`Declaring pic names
ballcounthit AS INTEGER = 0
IMG_BLOCK1 AS WORD = 30
IMG_BLOCK2 AS WORD = 31
IMG_BLOCK3 AS WORD = 32
IMG_BLOCK4 AS WORD = 33
IMG_BALL AS WORD = 20
`Load bitmaps
LOAD IMAGE "ball.bmp", IMG_BALL
LOAD IMAGE "block.bmp", IMG_BLOCK1
LOAD IMAGE "block.bmp", IMG_BLOCK2
LOAD IMAGE "block.bmp", IMG_BLOCK3
LOAD IMAGE "block.bmp", IMG_BLOCK4
`Where to put the sprites
ballx = 348
bally = 238
SPRITE 1, ballx, bally, IMG_BALL
block1x = 0
block1y = 0
SPRITE 2, blockx, blocky, IMG_BLOCK1
block2x = 540
block2y = 0
SPRITE 3, block2x, block2y, IMG_BLOCK2
block3x = 540
block3y = 405
SPRITE 4, block3x, block3y, IMG_BLOCK3
block4x = 0
block4y = 405
SPRITE 5, block4x, block4y, IMG_BLOCK4
REPEAT
CLS
`Controls
IF (RIGHTKEY())
ballx = ballx + 5
ENDIF
IF (LEFTKEY())
ballx = ballx - 5
ENDIF
IF (UPKEY())
bally = bally - 5
ENDIF
IF (DOWNKEY())
bally = bally + 5
ENDIF
SPRITE 1, ballx, bally, IMG_BALL
SPRITE 2, block1x, block1y, IMG_BLOCK1
SPRITE 3, block2x, block2y, IMG_BLOCK2
SPRITE 4, block3x, block3y, IMG_BLOCK3
SPRITE 5, block4x, block4y, IMG_BLOCK4
`Block disappears after ball hits
IF (SPRITE COLLISION(1 , 2))
`IMG_BLOCK1 = IMG_BALL
ballcounthit = ballcounthit + 1
ENDIF
IF (SPRITE COLLISION(1 , 3))
`IMG_BLOCK2 = IMG_BALL
ballcounthit = ballcounthit + 1
ENDIF
IF (SPRITE COLLISION(1 , 4))
`IMG_BLOCK3 = IMG_BALL
ballcounthit = ballcounthit + 1
ENDIF
IF (SPRITE COLLISION(1 , 5))
`IMG_BLOCK4 = IMG_BALL
ballcounthit = ballcounthit + 1
ENDIF
`If ballcounthit is greater then 3 then move the blocks to these new cordinates
IF ballcounthit > 3
block1x = 255
block1y = 308
block2x = 420
block2y = 0
block3x = 111
block3y = 290
block4x = 0
block4y = 25
ENDIF
SYNC
UNTIL (ESCAPEKEY())
END