Question regarding tap and touch listeners in storyboard scenes...

Hello,

I made a new puzzle game with storyboard. It is based on some of my old games I made with the director class. Now I moved everything to storyboard and it is working fine… BUT sometimes I encounter a strange behaviour regarding my touch and tap listeners for images (all in the sceneGroup) and I can’t find anything which is causing this.

My code is to much to post here… that’s why I just want to ask if you encountered strange behaviour regarding touch and tap listeners also?

What’s new in this game: I’m using a tap and a touch listener on the same images. When the puzzle is finished some listeners are removed, others should still work… BUT… the problem I have: in 5% of 100% ALL touch and tap listeners are removed… even the listeners which are added while the program is running aren’t working correctly! For example: The puzzle is finished and some touchable objects are created. But the touch on this objects isn’t possible and I can’t find the reason for it because everything else is working fine and the listeners are working in 95% all the time. I don’t get error messages btw.
Print statements near the addEventListener and removeEventListener are working and don’t show any problems. EventListeners should be active regarding the feedback.

That’s why I “hope” this maybe is some known problem with Storyboard or the listeners maybe!?

Do you have any ideas what can couse this strange behaviour?

Any help is appreciated because I don’t know where to look at anymore… tried a lot :slight_smile:

Best wishes and a Happy New Year!

Daniela
[import]uid: 137572 topic_id: 34426 reply_id: 334426[/import]

I had a little trouble following the problem exactly. Are you saying every object has both a touch and a tap listener? And you go to remove them later and about 5% of the time it fails for some reason?

Is there a reason you need both tap and touch on the same object? I would personally just watch for an “ended” phase on a touch event with no “moved” phases and only have the one handler.

Rob [import]uid: 199310 topic_id: 34426 reply_id: 136848[/import]

Hello Rob,

thanks for the fast feedback!

Regarding the listeners: I have different puzzlepieces in the game, each piece gets a tap and a touch listener, so the user can rotate the piece by 2 taps and moving the piece around by touching it.

When the pieces are in place I remove this listeners for each piece, but in 5% every listener in the game is not working anymore and no new listeners are added after the pieces are in place. For example: after the pieces are in place I create some balloons which can be destroyed by tapping them… the addListener for the balloons is called, but I can’t tap the balloons. In 95% everything works fine.

I know you can’t really help me without seeing my code… I just hoped maybe you have some ideas where I can look at… some things to avoid to “disable” listeners for a whole scene. I can’t find the reason why after the removal of the puzzlepiece listeners no new listeners for new display objects can be created. Maybe you have an idea?

Thank you in advance!

I wish you a Happy New Year’s Eve! :wink:

Daniela
[import]uid: 137572 topic_id: 34426 reply_id: 136882[/import]

I had a little trouble following the problem exactly. Are you saying every object has both a touch and a tap listener? And you go to remove them later and about 5% of the time it fails for some reason?

Is there a reason you need both tap and touch on the same object? I would personally just watch for an “ended” phase on a touch event with no “moved” phases and only have the one handler.

Rob [import]uid: 199310 topic_id: 34426 reply_id: 136848[/import]

Hello Rob,

thanks for the fast feedback!

Regarding the listeners: I have different puzzlepieces in the game, each piece gets a tap and a touch listener, so the user can rotate the piece by 2 taps and moving the piece around by touching it.

When the pieces are in place I remove this listeners for each piece, but in 5% every listener in the game is not working anymore and no new listeners are added after the pieces are in place. For example: after the pieces are in place I create some balloons which can be destroyed by tapping them… the addListener for the balloons is called, but I can’t tap the balloons. In 95% everything works fine.

I know you can’t really help me without seeing my code… I just hoped maybe you have some ideas where I can look at… some things to avoid to “disable” listeners for a whole scene. I can’t find the reason why after the removal of the puzzlepiece listeners no new listeners for new display objects can be created. Maybe you have an idea?

Thank you in advance!

I wish you a Happy New Year’s Eve! :wink:

Daniela
[import]uid: 137572 topic_id: 34426 reply_id: 136882[/import]