User Tag List

Results 1 to 6 of 6

Thread: Object created on restart & issues when game loses focus

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)

    Object created on restart & issues when game loses focus

    Hi

    Object created on restart:
    I have a bit of code that will create a sun every 30 seconds and it will move across the screen and perhaps drop a star. Works great... I've attached a screenshot.
    My very first line of code is to destroy the sun.

    The problem I'm having in Android is that when I press restart (jump to frame xxx) the sun immediately is created and moves across the screen - every single time I press restart.
    This only happens on my android device. It does not happen on the windows version or if I run the game from within fusion on my windows pc - which is a touch screen.

    Is there a way to stop this? Because the star that the sun drops gives you an extra life and I can't have someone getting an extra life for pressing restart.


    Game loses focus
    When the game loses focus it can create a lot of problems - or none at all. It's really random.
    I take a screenshot and the game then stops working until I restart the level - then it works fine again.
    Next time I take a screenshot with less objects in the room and it doesn't interfere with the game at all.
    I clicked on the notes at the top and then went back to the game and it wouldn't work - everything just stopped.
    Clicked on open folders and my level wouldn't end - it just hung - pressed restart and everything works again.
    I paused the game and pressed the home button and then it was impossible to get back to the game.
    Is there a way to simply just close the game when it loses focus which will solve this?

    I only ever use an Android device to test my own games, so is this kind of behaviour perhaps something Android users would be used to and think nothing of?

    Anybody have any ideas?

    Thanks
    sunshine_example.jpg

  2. #2
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,647
    Mentioned
    278 Post(s)
    Tagged
    4 Thread(s)
    mm I will check , but please can you do this

    start of Frame (add new event if you don't have it in your code) set timer 00" -00 and retest, let me know your results.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I tried that it made no difference. I set the timer to 00 00 on 2 levels and tested it - on both my sun was created right at the very start.

    I also tried - deactivate the sun control group at the start and activating it again at the end of the list i.e. deactivate at line 1 (start of frame) and activate at line 280 - didn't help.

    I also tried - deactivate the sun control group and set a timer event for 1 second - and then activated the group on the timer event - that just caused a 1 second delay for my sun to cross the screen.

    Just to clarify - the above only happens when I restart the level - it works perfectly fine when I don't restart the level.

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,647
    Mentioned
    278 Post(s)
    Tagged
    4 Thread(s)
    mm can you post a bug report with a small mfa showing this please.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Issue #3820 created.

    But this only applies to the first part of my query.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,006
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Further information:

    I changed the sun creation code to add 1 to a value every 1 second and then create the sun when the value reaches 30. This works exactly the same way and I no longer have the sun being created at restart.

    Losing Focus:
    I added in the android object to each level and set the command to quit the application when the menu button is pressed. This does nothing but it is voodoo (because now when you hit the menu button the game is correctly paused and you can come back to it and continue on.) Also now when I read the messages or take a screenshot it happens on top of the game and the game continues to run - so this is okay too.

    The only remaining issue is when I actively pause the game - I have a pause button on screen - and then go to the menu then when I come back to the game it is a black screen and if you know to press any key / tap the screen the game will return to you. This is a 100% identical problem that I have in all my windows games - but a kind person in the forums gave me a work around for that in windows. It's less of a problem with the Android version because the next logical step anyone is going to take is to tap the screen and then it returns the game. However, under these circumstances my level will not end. And it's the command - end the level when all the clouds are destroyed - that never runs. All the other instructions up to that point run - that last step that will close the level never completes so the game just hangs at the end of the level, waiting. If I press restart then everything works again 100% except you have to repeat the level. And it only happens under these conditions. I don't have a solution for this part.

    Edit: I put in a second step on the level end code - step one was last object has been destroyed - and that wouldn't trigger after a pause event if I exited the game during that pause event. I added in an additional event - last object destroyed in a zone - the zone being the visible screen. Since doing that my level ends every time and the game no longer hangs on a level end.

Similar Threads

  1. Replies: 4
    Last Post: 8th July 2016, 07:33 PM
  2. Bug: Can't stop movement ever again once flash loses focus
    By Burfelt in forum SWF/Flash Export Module Version 2.0
    Replies: 9
    Last Post: 11th March 2013, 09:27 AM
  3. BUG: Mouse inputs stop working if the app window loses focus in the debugger
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 3rd February 2012, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •