I FIGURED OUT THE LOOP I WAS LOOKING FOR CHECK IT OUT!!
[lua]display.setStatusBar( display.HiddenStatusBar ) – HIDE STATUS BAR
wordArray = {}
local i = 1
local loqsprite = require(‘loq_sprite’)
local screenW = display.contentWidth
local screenH = display.contentHeight
local BG = display.newImageRect(“background.png”, 1024, 768)
BG.x = screenW/2; BG.y = screenH/2
local chair = display.newImageRect(“chair.png”, 504, 208 )
chair.x = 488; chair.y = 248
local words = { “Pool”, “Jump”, “Splash”, “Wet”}
local listener
local mfactory = loqsprite.newFactory(“momWet”)
local mom = mfactory:newSpriteGroup()
mom.x = 468 ; mom.y = 68
local jfactory = loqsprite.newFactory(“girl”)
local girl = jfactory:newSpriteGroup()
girl.x = 920 ; girl.y = 750
atrace(xinspect(girl:getSpriteNames()))
function splash()
transition.to( girl, { time=1500, x= 1020, y= 800, alpha = 0 } )
local sfactory = loqsprite.newFactory(“splash”)
local splash = sfactory:newSpriteGroup()
splash.x = 520 ; splash.y = 350
splash:play(“splash splash”)
end
function bringBack ()
girl:prepare(“girlJump bending”)
transition.to( girl, { time=1500, x= 920, y=750, alpha = 1 } )
end
listener = function( event )
local phase = event.phase
local word = event.target
if ( phase == “ended” ) then
local function complete()
word.alpha = 0.5
local newIndex = (word.index % #words)+1
words[newIndex].alpha = 1
word:removeEventListener( “touch”, listener )
words[newIndex]:addEventListener( “touch”, listener )
end
– delay new word highlight if needed
timer.performWithDelay ( 100, complete )
– animations
if word.index == 1 then girl:play(“girlJump bending”); mom:prepare(“momWet sit”)
elseif word.index == 2 then girl:play(“girlJump jump”)
elseif word.index == 3 then splash();mom:prepare(“momWet wet”)
elseif word.index == 4 then mom:play(“momWet wet”); bringBack ()
end
end
end
– draw words
for i=1,#words do
local word = display.newText ( words[i], 0, 0, native.systemFont, 46)
word.x, word.y = 120, 120 * i
word:setTextColor( 255,0,0 )
word.index = i
words[i] = word
word.alpha = 0.5
end
words[1].alpha = 1
words[1]:addEventListener( “touch”, listener )[/lua][/lua]
Thanks again for all the help!! [import]uid: 51459 topic_id: 14806 reply_id: 57336[/import]