Can't make sence of scenes...what am i doing wrong?

The idea behind scenes is that you go to one, do stuff, then go to another.  If you start in scene 1 and goto scene2 that immediately jumps to scene 3, what purpose is scene 2 doing?  In your opponent_scene your enter scene has this code:

function opponent\_scene:enterScene(event )     print("opponent\_scene enter")     local group  = self.view     storyboard.removeScene("judge")     local text = display.newText("Opponent's turn",150,200)     storyboard.gotoScene("judge")     -- body end

which you seem to have moved the display.newText to your createScene, which is proper.   But when this scene is shown on the screen, it immediately changes to the judge scene.  You will see this scene for 1/2 second.  Is that what you want?

I am sorry for the late reply, i found a different approach… Now it is working :slight_smile:

@Rob, yes i wanted the screen to appear just for a second… i thought 1/2 second is ok as well…

Yeah, you can display it for 0.0001 seconds if you want to :slight_smile: (actually the timer resolution probably won’t allow that …)

With Finite State Machines - what Composer and Storyboard basically are, you have to be fairly careful with re-entrant state changes - i.e. if your scene messages are called from the gotoScene() code, calling them again from one of their methods is a bit chancy.

It might work, but events can end up being fired in the wrong order, or not at all and it’s a bit vulnerable to Corona changing the implementation slightly. Developers occasionally do this for some reason or other while retaining the consistency of the APIs.

If you want an scene that is basically just an interim scene, then it is probably best to fire it on a timer from the event rather than directly from it.

I didn’t get to read about timers so i have no idea what i am talking about, but i would think that a timer is no good for me, because i want the transition to the next scene to happen when the user presses on a card.

What is the exact problem you are having?  I suspect the thread has gone off topic a big. 

Thanks

Rob

Well, you have to attach an event listener to the card.

@Rob, the problem i was having is that the card’s touch event handler was not waiting for user input, i moved it into the enter scene and i now use only two storyboard files, so when the user presses on a card it goes to the opponent.lua storyboard scene and then back to player scene (you were right having a third scene was not helping)

@paulscottrobson, i did, but i did that in the create scene… so it wasn’t working as expected…