I understand. Thanks for all your help mate you've been really helpful.

I've had a little experience with arrays, but I'm not really sure what I would do for this situation. Could you possible talk me through it please?
When the player destroys the enemy the bullets and the enemy go hidden, but they are still there and collisions happen. I have moved them the sprites, but they move to the desired place, but instantly move back again. How could I solve this mate?
`Players bullet hitting the enemies ship
if BulletFire=1
if sprite collision(2,3)>0
hide sprite 3
rem hide sprite 4
`Just to see if it moves or not and it does, but it moves straight back to the original position it was destroyed from.
sprite 4,0,0,4
endif
if sprite hit(2,3)>0
play sound 2
score=score+10
sprite 5,xalien,yalien,5
wait 1000
sprite 5,-200,0,5
rem hide sprite 5
endif
endif
Thanks
Edit: I have two enemies on the screen at once but it really lags the game. I didn't use an array so I think thats whats making it lag?
remstart
Gradius type game by Bankzy108
Started: 05-06-09 (UK Format)
Needs to be completed by: 24-06-09 (UK Format)
Images:
1 - Player Ship
2 - Player Bullet
3 - Enemy Ship
4 - Enemy Bullet
5 - Explosion
50 - Background
Sprites:
1 - Player Ship
2 - Player Bullet
3 - Alien Ship
4 - Alien bullet
5 - Explosion
6 - Alien Ship 2
7 - Alien bullet 2
Sounds:
1 - Main Music
2 - Explosion Sound
To do list:
1 - Get ship explosions working right
2 - Add a bullet fire sound (even though there is no sound in space)
3 - Maybe use paste sprite for player ship so score and life is always on top
of player ship (have to hide the sprite and move ship paste sprite
command above score and life printing)
remend
sync on
hide mouse
load image "Backgroundredo.png",50,1
load image "ship.bmp",1,1
load image "bullet1changed.bmp",2,1
load image "enemyship.png",3,1
load image "enemybullet.bmp",4,1
load image "explosion.bmp",5,1
rem Load a wav sound file into number one
load sound "MetalGearTune.wav",1
rem Load a wav sound file into number one
load sound "Explosionsound.wav",2
sync rate 0
ink rgb(255,255,255),0
`The input string
InpStr$ = ""
` Set the max number of characters in the string
MaxLength=3
` Wait until the user stops pressing the return key
clear entry buffer
repeat
until returnkey()=0
repeat
`Handle input
char$ = entry$()
select asc(char$)
case 8 : `Backspace
InpStr$ = left$(InpStr$, len(InpStr$) - 1)
endcase
case 14 : `Carriage return
`In this case, we do nothing. It's just to prevent that a carriage return
`is added to InpStr$
endcase
case default
` Check if the length of InpStr$ is less than the max length
if len(InpStr$)<MaxLength
InpStr$ = InpStr$ + char$
endif
endcase
endselect
clear entry buffer
`Display the text
cls
set text size 16
center text 320,200, "Enter you initals below then press enter:"
set text size 14
center text 320,250, InpStr$
sync
until returnkey()=1
cls
center text 320, 200, "Get Ready"
wait 2000
`GAME starts here
sync on
rem Play sound number
play sound 1
`Players spaceship position
xpos=0
ypos=220
image=2
`Score Variable
score=0
lifes=3
`Alien Position
yalien=rnd(443)
xalien=640
yalien2=rnd(443)
xalien2=640
BackX=0:BackY=0 :` Background x and y coordinates
BackSpeed=1 :` Background scroll speed (pixels to decrease from BackX)
DO
` Place the background image
paste image 50,BackX,BackY
` Show where BackX is (rem or delete this once you see what it's doing)
rem text 100,0,"BackX = "+str$(BackX)
` Move the background
dec BackX,BackSpeed
` Check if the background has hit the limit and reset to BackX to zero
if BackX<-5120 then BackX=0
rem Lifes left text on the screen
set text size 10
ink rgb(255,255,255),0
text 10,465,"Lifes Left: "+str$(lifes)
rem Score text on the screen
text 10,15,"Score: " +str$(score)
` Player move up
if upkey()=1
ypos=ypos-5
` Check if ypos is beyond the limits of the screen and set to zero if it is
if ypos<0 then ypos=0
endif
` Player move down
if downkey()=1
ypos=ypos+5
` Check if ypos is beyond the limits of the screen and set to 443 if it is
if ypos>443 then ypos=443
endif
rem Update sprite
sprite 1,xpos,ypos,1
`Alien Sprite update
sprite 3, xalien,yalien,3
xalien=xalien-1
sprite 6, xalien2,yalien2,3
xalien2=xalien2-1
`Enemy fire back
if Enemyfire=0
alienbulletxpos=xalien-15
alienbulletypos=yalien+13
alienbulletxpos2=xalien2-15
alienbulletypos2=yalien2+13
Enemyfire=1
endif
if Enemyfire=1
`Show the bullet
sprite 4,alienbulletxpos,alienbulletypos,4
sprite 7,alienbulletxpos2,alienbulletypos2,4
`Increase the bullets x coordinate
alienbulletxpos=alienbulletxpos-5
alienbulletxpos2=alienbulletxpos2-5
`Check if the bullet is off the screen
if alienbulletxpos=<0 then Enemyfire=0
if alienbulletxpos2=<0 then Enemyfire=0
endif
` Check fire button and if there's no bullet already on the screen
if spacekey()>0 and BulletFire=0
` Set the starting x and y of the player bullet
bulletxpos = xpos+44
bulletypos = ypos+18
` Turn on BulletFire switch (so the program knows to make a bullet)
BulletFire=1
endif
` Check if the Bullet has been fired
if BulletFire=1
` Show the bullet
sprite 2,bulletxpos,bulletypos,2
` Increase the bullets x coordinate
bulletxpos=bulletxpos+5
` Check if the bullet is off the screen (and turn off BulletFire switch if it is)
if bulletxpos=>640 then BulletFire=0
endif
`Players ship hitting the enemies ship
if sprite collision(1,3)>0
hide sprite 1
hide sprite 3
endif
if sprite hit(1,3)>0
play sound 2
sprite 5,xalien,yalien,5
lifes=lifes-1
wait 500
sprite 5,-100,0,5
rem hide sprite 5
wait 1000
show sprite 1
xpos=0
ypos=220
endif
`Players bullet hitting the enemies ship
if BulletFire=1
if sprite collision(2,3)>0
hide sprite 3
hide sprite 4
rem sprite 4,0,0,4
endif
if sprite hit(2,3)>0
play sound 2
score=score+10
sprite 5,xalien,yalien,5
wait 1000
sprite 5,-200,0,5
rem hide sprite 5
endif
endif
`Enemies bullet hitting the players ship
if sprite collision(4,1)>0 then hide sprite 1
if sprite hit(4,1)>0
lifes=lifes-1
play sound 2
sprite 5,xpos,ypos,5
wait 500
sprite 5,-300,0,5
rem hide sprite 5
wait 1000
show sprite 1
xpos=0
ypos=220
endif
`Players ship hitting the enemies ship
if sprite collision(1,6)>0
hide sprite 1
hide sprite 6
endif
if sprite hit(1,6)>0
play sound 2
sprite 5,xalien2,yalien2,5
lifes=lifes-1
wait 500
sprite 5,-100,0,5
rem hide sprite 5
wait 1000
show sprite 1
xpos=0
ypos=220
endif
`Players bullet hitting the enemies ship
if BulletFire=1
if sprite collision(2,6)>0
hide sprite 6
hide sprite 7
rem sprite 4,0,0,4
endif
if sprite hit(2,6)>0
play sound 2
score=score+10
sprite 5,xalien2,yalien2,5
wait 1000
sprite 5,-200,0,5
rem hide sprite 5
endif
endif
`Enemies bullet hitting the players ship
if sprite collision(7,1)>0 then hide sprite 1
if sprite hit(7,1)>0
lifes=lifes-1
play sound 2
sprite 5,xpos,ypos,5
wait 500
sprite 5,-300,0,5
rem hide sprite 5
wait 1000
show sprite 1
xpos=0
ypos=220
endif
rem if lifes=0
rem hide all sprites
rem cls
rem goto leaderboard
rem endif
sync
Loop