if not one thing, — it’s another …
you need to have a lot of patience for programming… a lot.
I admired you guys a lot.
I thought I might use an “if – else” statement. There I go.
local function doneButton () transition.to(done, {time=200, y=(centerY + 600)}) transition.to(song1, {time=100, x=opX, y=opY, xScale=1, yScale=1}) audio.stop () if greenBar1.x \< 1000 then print ("this is the FIRST time") transition.cancel(reset1) greenBar1.x = 150 greenBar1.isVisible = false elseif greenBar2.x \< 1000 then print ("this is the SECOND time") greenBar2.isVisible = false transition.cancel(reset2) greenBar2.x = 150 end end
I try different forms, I think I have the idea…
I even put “print”
but in Terminal I don’t see the SECOND time
I guess it’s not detecting the – elseif ********* then
I don’t know why.
I really need help, I’m very close, but not yet!
sorry I did not see the “Full code please”
here it is.
local play1 = audio.loadSound ( "music1.mp3" ) display.setStatusBar( display.HiddenStatusBar ) local background = display.newImage("bg.png") local greenBar1 local greenBar2 local done local reset1 local reset2 local centerX = display.contentWidth / 2 local centerY = display.contentHeight / 2 local opX = 240 -- original placed .x local opY = 580 local tx1 = display.newText ("a Text messaging, or texting, is the act of typing and sending a brief, electronic message between two or more mobile phones or fixed or portable devices over a phone network. The term originally referred to messages sent using the Short Message Service (SMS); it has grown to include messages containing image, video, and sound content (known as MMS messages). The sender of a text message is known as a texter, while the se itself has different colloquialisms depending on itself has different colloquialisms depending on the region. It may simply be referred to as a text in North America, the United Kingdom, Australia an itself has different colloquialisms depending on the region. It may simply be referred to as a text in North America, the United Kingdom, Australia and the Philippines, an SMS in most of d the Philippines, an SMS in most of the region. It may simply be referred to as a text in North America, the United Kingdom, Australia and the Philippines, an SMS in most of rvice itself has different colloquialisms depending on the region. It may simply be referred to as a text in North America, the United Kingdom, Australia and the Philippines, an SMS in most of mainland Europe, and a TMS or SMS in the Middle East, Africa and Asia.a vea ver si le atinoaa ver si le atino ver si lea ver si le atino atinor se atinoea ver si le ata ver si le atinoino a vea ver si le atinoaa ver si le atino ver si lea ver si le atino atinor si le atinoatino", 30, 20, 452, 400, nil, 18) local song1 = display.newImage("music1.png") song1.x = opX song1.y = opY local function playSong () transition.to(done, {time=200, y=(centerY + 340)}) transition.to(song1, {time=100, x=centerX, y=centerY, xScale=2.5, yScale=2.5}) greenBar1.isVisible = true local function secondStaff () greenBar1.isVisible = false greenBar2.isVisible = true reset1 = transition.to(greenBar1, {time=100, x=150, y=310}) local function smallFrame () greenBar2.isVisible = false transition.to(song1, {time=100, x=opX, y=opY, xScale=1, yScale=1}) reset2 = transition.to(greenBar2, {time=100, x=150, y=580}) end reset2 = transition.to(greenBar2, {time=14800, x=1000, onComplete=smallFrame}) end reset1 = transition.to(greenBar1, {time=14800, x=1000, onComplete=secondStaff}) audio.play(play1) end song1:addEventListener("tap", playSong) greenBar1 = display.newRect(0, 0, 7, 200) greenBar1:setFillColor(140, 255, 140) greenBar1.x = 150 greenBar1.y = 310 greenBar1.isVisible = false greenBar2 = display.newRect(0, 0, 7, 200) greenBar2:setFillColor(140, 255, 140) greenBar2.x = 150 greenBar2.y = 580 greenBar2.isVisible = false done = display.newImage("manzana.png") done.x = centerX done.y = centerY + 600 done:scale (.5, .5) local function doneButton () transition.to(done, {time=200, y=(centerY + 600)}) transition.to(song1, {time=100, x=opX, y=opY, xScale=1, yScale=1}) audio.stop () if greenBar1.x \< 1000 then print ("this is the FIRST time") transition.cancel(reset1) greenBar1.x = 150 greenBar1.isVisible = false elseif greenBar2.x \< 1000 then print ("this is the SECOND time") greenBar2.isVisible = false transition.cancel(reset2) greenBar2.x = 150 end end done:addEventListener("tap", doneButton)
Thanks