all parameters between the curly brackets are ignored…
also object:remove() doesn’t work or is that the wrong way to remove a sprite object?
also how
function generateStarField()
for i = 1, Stars\_total do
local Star = {}
Star = display.newImage("Star",(i\*28)+(math.random(1,5)\*10),-55\*math.random(0,110)) --\> this doesn't work
Star = math.random(1,10)
Star = 20
Star = sprite.newAnim{"explosion001.png","explosion002.png","explosion003.png","explosion004.png","explosion005.png","explosion006.png","explosion007.png","explosion008.png","explosion009.png","explosion010.png"}
Star = 30
Star = 30
Stars[i] = Star
end
end
function collisionDetect()
.
.
.
if ColCheck(Stars[j].object,ship) then
Stars[j].object.explosion:play{ startFrame=1, endFrame=10, loop=1, remove=true } --\> this doesn't work
-- Stars[j].object.isVisible = false
-- Stars[j].object.explosion:remove() --\> this doesn't work
-- print("hit")
Stars[j].object.explosion.x = Stars[j].object.x
Stars[j].object.explosion.y = Stars[j].object.y
end
end
.
.
.
end
THX
M [import]uid: 6553 topic_id: 1083 reply_id: 301083[/import]
I can see where you got the OBJECT from. But there is no such parameter/Property in corona.
Is this Actionscript code which you thought just runs in Corona? Or is this already something from the GameEdition?
And in your code sample, you overwrite
a variable with integer values.
When you do this, you just store the integer:
[lua]Star = sprite.newAnim{“explosion001.png”,“explosion002.png”,“explosion003.png”,“explosion004.png”,“explosion005.png”,“explosion006.png”,“explosion007.png”,“explosion008.png”,“explosion009.png”,“explosion010.png”}
– The next line overwrite the value of Star and so later you store just the integer.
Star = 30
Star = 30
Stars[i] = Star[/lua] [import]uid: 5712 topic_id: 1083 reply_id: 2722[/import]
for i = 1, Stars_total do
local Star = {}
Star.object = display.newImage(“Star.png”,(i*28)+(math.random(1,5)*10),-55*math.random(0,110))
Star.object.speed = math.random(1,10)
Star.object.radius = 20
Star.object.explosion = sprite.newAnim{“explosion001.png”,“explosion002.png”,“explosion003.png”,“explosion004.png”,“explosion005.png”,“explosion006.png”,“explosion007.png”,“explosion008.png”,“explosion009.png”,“explosion010.png”}
Star.object.explosion.x = 40
Star.object.explosion.y = 40
Stars[i] = Star
end
end
[/code] [import]uid: 6553 topic_id: 1083 reply_id: 2727[/import]