Can't get "enemy" character appear
Posted: Tue Nov 11, 2014 3:25 pm
When I run the code for game I am creating for my Advanced Higher i can't get the enemy ship to appear on screen and i don't know what is causing this to happen, or rather not happen.
This is the section of code I am trying to get to work and spawn in enemies.
Code: Select all
on createalien
create invisible image "canvas.png"
set the loc of image "canvas.png" to (random(500),0)
//Undecied on size yet, Decide on size
set the width of "canvas.png" to 128
set the height of "canvas.png" to 32
movealien
end createalien
on movealien
if the visible of "canvas.png" is false then set the visible of image "canvas.png" to true
set the top of image "canvas.png" to (the bottom of image"canvas.png" + 2)
if the top of image "canvas.png" >= 582 then
delete image"canvas.png"
put (lives - 1) into lives
else
if checkalien() is true then
delete image "canvas.png"
-- hide group "enemy" with visual effect dissolve very fast
set the loc image "shooter" to (327,289)
send startalien to me in random(1000) milliseconds
exit movealien
end if
end if
if there is an image "canvas.png" then send movealien to me in 4 milliseconds
end movealien