okay, this is pretty sad, but I can't get rid of all the sprites in my game. Could you help? The part where I delete all the sprites is at the bottom of the code.
`****************************************************************
`*************************~LASER Assault!~***********************
`****************************************************************
`*************************By Shaun Allison***********************
`****************************************************************
hide mouse
cls rgb(0,0,0)
`sprites: 1-player, 2/51-lasers,
Load animation "loading1.avi", 3
sleep 1000
Play animation 3,160,120
sleep 3000
`Loading stuff
Load image "ablast1.bmp",1
Load image "ablast2.bmp",2
Load image "ablast3.bmp",3
Load image "blue laser.bmp",4
Load image "green laser.bmp",5
Load image "pink laser.bmp",6
Load image "red laser.bmp",7
Load image "white laser.bmp",8
Load image "explode1.bmp",10
Load image "explode2.bmp",11
Load music "torrent.mid",1
Load sound "edestroy.wav", 1
Load sound "getready.wav",2
Load animation "getready1.avi",1
Load animation "failed1.avi",2
Load animation "congrat1.avi",3
`VARIABLES
xpos = 10 :`x position of player's ship
ypos = 190 : `y position of player's ship
image = 1 : `Frame number of the animation of the player's ship
direction = 3 : `Direction of player's ship - used for slowing down effect
breakspeed = 5 : `Speed of which the player's ship slows down - lower = faster - used in slowing down effect
speed = 0 : `Speed of player's ship - used in slowing down effect
lasercreation = 50 : `speed of which the lasers are created
maxlasers = 50 : `maximum amount of lasers on the screen at a time
lasercounter = 0 : `counter used with lasercreation for speed of making the lasers
lasers = 0 : `amound of lasers on the screen
explodespeed = 0 : `counter for how long the frames of the explosion animation last
paused = 0 : `If it is one, the lasers and other game objects freeze.
explodeanim = 10 : `Frame of the explosion animation
DIM laser(50,4) : `Laser stats - xpos,ypos,speed,color
sync on
`Getready animation and music
Play animation 1,160,120
play sound 2
sleep 3000
delete animation 1
cls rgb(0,0,0)
Loop music 1
starttime = Timer()
`MAIN LOOP!
Do
`CREATES THE LASERS!
If lasercounter > lasercreation and lasers < maxlasers and paused = 0
lasercounter = 0
makelaser(lasers)
lasers = lasers + 1
endif
`LASER STUFF!
For I = 1 to lasers
`MOVES THE LASER!
If paused = 0 then laser(I,1) = laser(I,1) - laser(I,4)
`WARPS THE LASER!
If laser(I,1) < -48 then makelaser(I)
`DRAWS LASER
sprite I+1, laser(I,1), laser(I,2), laser(I,3)
`CHECKS COLLISION
If sprite collision(1,I) = 1 and I > 1
sprite lasers + 2, xpos - 40, ypos - 40, explodeanim
If paused = 0 then Play sound 1
paused = 1
endif
Next I
`CONTROLLS!
IF Leftkey() = 1 and paused = 0
direction = 2 : speed = breakspeed
endif
If rightkey() = 1 and paused = 0
direction = 3 : speed = breakspeed
endif
If upkey() = 1 and paused = 0
direction = 1 : speed = breakspeed
endif
If downkey() = 1 and paused = 0
direction = 4 : speed = breakspeed
endif
`KEEPING THE SHIP WITHIN THE SCREEN!
If speed > 0
If xpos < 1
speed = 0 : xpos = xpos + 1
Endif
If xpos > 639 - sprite width(1)
speed = 0 : xpos = xpos - 1
Endif
If ypos < 1
speed = 0 : ypos = ypos + 1
Endif
If ypos > 479 - sprite height(1)
speed = 0 : ypos = ypos - 1
endif
`MOVING THE SHIP! and paused = 0
If direction = 1
ypos = ypos - speed : speed = speed - 2
endif
If direction = 2 and paused = 0
xpos = xpos - speed : speed = speed - 2
endif
If direction = 3 and paused = 0
xpos = xpos + speed : speed = speed - 2
endif
If direction = 4 and paused = 0
ypos = ypos + speed : speed = speed - 2
endif
Endif
`DRAWING THE SHIP AND IT'S ANIMATION!
image = image + 1 : If image > 3 then image = 1
sprite 1,xpos,ypos,image
lasercounter = lasercounter + 1
If paused = 1 then explodespeed = explodespeed + 1
If explodespeed = 7 then explodeanim = explodeanim + 1
If explodespeed = 30
losegame
endif
sync
cls
set cursor 0,0
Print timer() - starttime
If timer() - starttime > 50000 then wingame
`!!!
Loop
Function makelaser(number)
laser(number,1) = 640
laser(number,2) = rnd(476)
laser(number,3) = rnd(4)+4
laser(number,4) = rnd(6)+4
Endfunction
Function losegame
stop music 1
For I = 1 to lasers+1: delete sprite I: next I `HELP!!!
sync
Play animation 2,160,120
sleep 3000
end
Endfunction
Function wingame
stop music 1
For I = 1 to lasers+1: delete sprite I: next I `HELP!!!!!
sync
play animation 3,160,120
sleep 3000
end
Endfunction
Green Bunnies rule!