@RonJeffries - been following your development of Asteroids with interest, like to see how real coders approach projects. I never seem to be able to finish mine, hit a snag, shelve and start a new project. Trying to get round that now.
I have made a few mods to your project on my pad - deleted the testAsteroids tab. Moved and modified the score display (just personal preferences).
function drawScore()
local s= "000000"..tostring(Score)
s = string.sub(s,-5)
fill(255, 253, 0)
fontSize(32)
text(s, WIDTH/2, HEIGHT-60)
end
Slightly modified the drawAsteroid() function to partially hide the circle showing the asteroid size by making it more transparent (still retained it for development).
function drawAsteroid(asteroid)
pushMatrix()
pushStyle()
translate(asteroid.pos.x, asteroid.pos.y)
stroke(253, 41)
ellipse(0,0,2*killDist(asteroid))
scale(asteroid.scale)
stroke(255)
strokeWidth(1/asteroid.scale)
for i,l in ipairs(asteroid.shape) do
line(l.x, l.y, l.z, l.w)
end
popStyle()
popMatrix()
end
Also, I increased the stroke and changed the colour on the ship to make it more prominent - just my preference.
I know these deviate from the original, but I think they do lift it a bit. Are you intending explosion of the ship on collision with asteroids?
Will continue to follow this, very neat and very professional. Thanks.
p.s. made me go back to my own thread with space invaders, which I hoped would suck in ideas, suggestions and code ideas. Must finish that!!!
p.p.s - not your code, but I have an issue with buttons near the iPad screen edge, dragging in other windows - distracts the concentration of us space pioneers dealing with the asteroid storm!!! I have raised this with @Simeon to see if we can switch out some iOS features to avoid this.