Hello,
I am trying to do this: When the parallax restarts from the beginning of the level I want to reset the coins so that they are viewable. This option is done by resetting the coins alpha from 0 to 1. Any suggestions on how to do this. I am using LevelHelper to implement this game. My code can be downloaded here: http://www.mediafire.com/?b3331b1h55w387b.
The previous implementation is done by
parallaxNode:registerSpriteHasMovedToEndListener(spriteInParallaxHasReset)
This is added after the following code:
parallaxNode = loader:parallaxNodeWithUniqueName("Parallax\_1")
if(nil == parallaxNode)then print("Could not find parallax node.") end
then this added above the create scene:
function spriteInParallaxHasReset(sprite)
if(LevelHelper\_TAG.COIN == sprite.lhTag)then
sprite.alpha = 1;
end
end
The first part of the implementation was changed to this:
Runtime:addEventListener( "LHParallaxSpriteMovedBackNotification",
parallaxEnd)
This next part is what I have come up with:
local parallaxEnd = function(event)
if(event.movedSprite == LevelHelper\_TAG.COIN) then
LevelHelper\_TAG.COIN.alpha = 1
end
end
Thanks,
Elijah [import]uid: 159438 topic_id: 35645 reply_id: 335645[/import]