User Tag List

Results 1 to 9 of 9

Thread: objects overlap when using flags

  1. #1
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Exclamation objects overlap when using flags

    so im having an issue - i have a tutorial that pops up when a player goes into a new level, the group of events "Pause" deactivates some other groups to make sure nothing happens while the player reads, which is controlled by flags. in this particular level i have these walls that close in on the player and when the player shoots at them they get pushed back. all this works but when i set the walls to stop when flag "Pause Detection" is off and start when "Pause Detection" is on it causes the walls to not collide with each other correctly, making them go through on another when theyre supposed to stop when they collide. i tried setting their speed to 0 and back to 14 instead and it still didnt work. i checked all my code and nothing should really cause this to happen, im not sure what else im supposed to do. the walls are set as bouncy balls btw. thanks

    1.png
    2.png
    3.jpg

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

    Option A
    Use a global value - Pause_Control = 0 when the tutorial is on and Pause_Control = 1 when the tutorial is off. Add that into the collision event i.e. only detect the collision when Pause_Control = 1.

    Option B
    Put all your game mechanisms in a single group called PLAY.
    Place the TUTORIAL group in its own group.
    Have the Tutorial deactivate the entire Play group and stop everything, and then reactive it when it is finished.
    Place a on group activation event in the play group that starts things moving (not in the Tutorial group).

    Option C
    Instead of a collision event, use an overlap event with a control, for example, only execute once when the frame loops, or set a flag on and off so that it only triggers once, and then reset the flag after they have reversed direction so that the overlap will trigger again.

  3. #3
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 i went with option c. so i tried doing it this way and it seemed to have worked, do you think its written correctly or should i make adjustments? fms.png

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,190
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    You should change it.

    You can set the flag on as you have it. But only set the flag off later when you change the direction. (Now you're setting the flag on and off in the same run - I'm surprised it actually works.)

  5. #5
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 like this? fms2.png

  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,190
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what you are doing with that code there.

    The walls move in towards each other and then there is a collision, and they change direction. and move apart again to the edge of the screen. It is only once they reach the edge of the screen and start moving towards each other again, that you need to reset the flag. In other words, find that line in your editor, and add the flag reset to that line. (If that's what you did - then that's great.)

    Alternatively you can set a value:
    when they overlap set value A = 30
    if value A > 0, subtract 1
    if value A = 0 reset the flag.

    Keep in mind, you might have to put a reset in with the player actions, I'm not sure how the player shooting the wall affects it.

  7. #7
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 ok im hoping that i got it right this time, i made the adjustment on line 67, and changed line 74 back to the original code. hjkj.png fms.png

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,190
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    It looks right to me. Does it work?!

  9. #9
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 it does

Similar Threads

  1. Replies: 8
    Last Post: 17th January 2019, 07:24 AM
  2. Don't want objects to overlap.
    By Vilhjalmr in forum Fusion 2.5
    Replies: 1
    Last Post: 17th February 2015, 07:51 AM
  3. creating objects without overlap
    By SolarB in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th July 2012, 02:48 PM
  4. Named Flags for Active Objects?
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd May 2007, 08:59 PM
  5. Two objects overlap. Delete only one.
    By Dines in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 8th April 2007, 11:29 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
  •