I'm tring to get multiple sprites on screen but I cant get it work. I also tried sync, inside the for next loop and right after it. I can get the sprites to appear without the loop but I need to store them in an varible so I can identify them later with ease.
`enemy
Dim Enemies(10)
for e = 4 to ememies
sprite e,300,10,4
sprite e,300,30,4
sprite e,300,50,4
next e
And here is the full source if needed:
Rem Project: What The!
Rem Created: 7/7/2003 8:59:34 JesterDev
Rem ***** Main Source File *****
Sync on
Hide Mouse
`load the main game images
Load image "ship.bmp",1,1
load image "back.bmp",2,1
load image "bullet.bmp",3,1
load image "eye.bmp",4,1
`load some sounds
load sound "fire.wav",1
load sound "impact.wav",2
rem players start position
y=370
x=320
`Background
sprite 2,0,0,2
`Set up some bullets
Bullet=3
bullets_life = 0
`enemy
Dim Enemies(10)
for e = 4 to ememies
sprite e,300,10,4
sprite e,300,30,4
sprite e,300,50,4
next e
`*********************
`******MAIN LOOP******
`*********************
do
sync
`ship
sprite 1,x,y,1
`if upkey()=1 then y=y-2
`if downkey()=1 then y=y+2
if rightkey()=1 then x=x+2
if leftkey()=1 then x=x-2
if x >= 590 then x=x-4
if x <= 60 then x=x+4
OFFSET SPRITE 1, SPRITE WIDTH(1)/2, SPRITE Height(1)/2
`Fire Bullet
if spacekey() = 1 and bulletlife = 0
bulletlife = 1
sprite bullet,x-10,y-40,3
play sound 1
endif
If sprite exist(bullet) then move sprite 3,4 : bulletlife=0
`This next line it is where I fixed the error:
if sprite exist(bullet)
if sprite hit (bullet,4)=1
play sound 2
delete sprite 4
endif
endif
sync
loop
``````````````````````````````````````