Hey Guys!
So, I’ve got another question… I’m trying to make some snow fall and the snow is deleting as soon as it appears… It’s proably something simple!
Anyway Here’s the code!
~Caleb
[code]
function makesnow()
local snowfall= display.newCircle(240,200,4)
mastergroup:insert(snowfall)
snowfall:setFillColor(210,210,210)
snowfall.y= 200–20
snowfall.x= math.random(0,340)
function snowfall:enterFrame(event)
self.x= math.random(0,340)
self.y= 200
self.life=10
self.life= self.life-.1
print(self.life)
if (self.life == 0) then
Runtime:removeEventListener(“enterFrame”,self);
self:removeSelf();
end
end
Runtime:addEventListener(“enterFrame”,snowfall)
end [import]uid: 95032 topic_id: 16392 reply_id: 316392[/import]