Hi,
I have the following code
set window on:set display mode 800,600,32
sync rate 60:sync on:hide mouse
set image colorkey 0,0,0
load image "gfx\ship1.png",1,1
load image "gfx\back02.png",2,1
load image "gfx\AlienFighter01.png",3,1
randomize 10
`---------------------------------------------------------------
type ship
field x,y,speed
endtype
dim sship(1) as ship
sship(1).x=100
sship(1).y=100
sship(1).speed=3
`---------------------------------------------------------------
type alien
field x,y,speed
endtype
for a=2 to 16
dim aalien(a) as alien
aalien(a).x=rnd (700)
if aalien(a).y=<100
aalien(a).y=rnd (480)
endif
if aalien(a).speed=<1
aalien(a).speed=rnd (4)
endif
next
`---------------------------------------------------------------
global sc$="00000000"
global lives$="5"
do
cls 0
text 0,10,"SCORE "+sc$:text 740,10,"LIVES "+lives$
line 0,40,800,40
sprite 1,sship(1).x,sship(1).y,1
if upkey()=1
if sship(1).y>50
sship(1).y=sship(1).y-sship(1).speed
endif
endif
if downkey()=1
if sship(1).y<460
sship(1).y=sship(1).y+sship(1).speed
endif
endif
if leftkey()=1
if sship(1).x>0
sship(1).x=sship(1).x-sship(1).speed
endif
endif
if rightkey()=1
if sship(1).x<600
sship(1).x=sship(1).x+sship(1).speed
endif
endif
if controlkey()=1
text 200,200,"FIRE!!!!!!!!!!!!"
endif
updatealien()
paste image 2,0,455
line 0,584,800,584
sync
loop
`---------------------------------------------------------------
function updatealien()
for a=2 to 16
sprite a,aalien(a).x,aalien(a).y,3
aalien(a).x=aalien(a).x-aalien(a).speed
if aalien(a).x<-100
aalien(a).x=800
endif
next
endfunction
`---------------------------------------------------------------
The images I'm using for sprites have a transparency of rgb 0,0,0
However I am getting a black box drawn around the alien sprites when the mainship sprite goes over them. Can someon please point out the glaring error I probably have ?
I've decided to have a play with dbp's 2d hence the coding mess posted
Thanks
Steve
PS Sorry it's not very well commented (ie at all), but I usually add comments part way through and haven't bothered yet..
For game/demo music for YOUR PC productions visit:-www.futuredevelopments.org.uk