User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Destroy an object forever

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Corborus's Avatar
    Join Date
    Jul 2017
    Posts
    45
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Destroy an object forever

    Hello,
    I am making a platform game for ANDROID with differents frames (that are worlds). The player can go trought the different frames and get differents objects like "coins". But I have a problem. When I start the game, the player is in frame 1. The player pick up a coin and it is destroyed. Now the player go trought a door to another world (Frame 2) and when the player return trought that door to the frame 1 again, the coin is there again. I tought that the function of a "Global object" was used for the thing i want to do, but it doesn´t work. So, is there a way to destroy an object forever and do not reapear if I go to the frame again?

    Thank you so much!

  2. #2
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    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)
    advaith's Avatar
    Join Date
    Jun 2015
    Location
    SF Bay Area, California, USA
    Posts
    1,324
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Are all the coins multiple instances of the same object, or are they different objects?

    Sent from my SM-T280 using Tapatalk

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Corborus's Avatar
    Join Date
    Jul 2017
    Posts
    45
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    They are all multiple instances of the same object. =S

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Admittedly i'm a bit rusty in Fusion but if you're using a global object i'd try setting an alterable variable or flag on the coin when it's picked up by the player and then, at the start of the frame, run through each coin and destroy every instance with said flag or value set

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Corborus's Avatar
    Join Date
    Jul 2017
    Posts
    45
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your answer, but it doesnt work, casue when the frame is resarted the flag of the coins turn on again.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea, that was not a good suggestion since destroying the object will reset the flag. So i'm thinking instead of actually destroying the coin, you could use flags to set their visibility and position

    If a coin has been picked up, set it's flag on and move it outside the play area. That way it will appear to have been destroyed but you should be able to keep track of them using flags

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    jn2002dk's Avatar
    Join Date
    Mar 2014
    Posts
    217
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very dirty example of what i mean here

    There is probably a much more elegant way of doing this but as i said, i'm a bit rusty

    Anyway, it works but you need to have different names for the coin in each frame

    Application 1.mfa

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Destroy an object forever

    Easiest way if you have multiple instances of the coin, is to spread value in an alterable value ID so the coins can be distinguished from one another. When you collect a coin, record the ID value in an array file, then destroy the coin. Save the Array when you leave the frame. Then when you come back to the level, at the start of frame spread the value again so the IDs are matched up to the coins again. Then use a fast loop to go through each row in the array and read the saved ID values, comparing the alterable value ID of the coin to the value in the array file. That will select the specific coin and you can destroy it.

    No need to worry about have multiple different coin types in your game.

    You can also use the Z-index of the array for separate levels so all of your save data can be contained in one array.


    Sent from my iPhone using Tapatalk

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    665
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sumo View Post
    ... Then use a fast loop to go through each row in the array and read the saved ID values, comparing the alterable value ID of the coin to the value in the array file. ...
    I'm curious how to do this part correctly with the Array object, Sumo.

    Can you update this example file later, please?

    (example has moved to my next post)

  10. #10
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Destroy an object forever

    Yeah I'm at work now but I'll check it out later. I'll try to explain it in a bit more detail if you want to test it out.

    +Start of Frame
    -Start fastloop "load array" - number of loops is equal to the Y dimension of the array

    +On loop "load array"
    +Compare to coin alterable ID value = Retrieve data from array XY (X = 0, Y = fastloop "load array" index)
    - Destroy coin

    Assuming the array has a 0 based index. It's better this way since fastloops also have a 0 based index. Make sure to compare to the alterable value of the coin directly instead of using compare two general values. Compare two general values doesn't account for object scope.


    Sent from my iPhone using Tapatalk

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 12th April 2017, 12:47 PM
  2. Player sliding forever after jumping (MFA included)
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th January 2015, 01:32 PM
  3. where can I get mmf2 extensions Ive benn googling forever
    By dov_b in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd July 2012, 03:05 PM
  4. Looping Background Forever
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th May 2010, 05:08 PM
  5. This has been bugging me for forever!!!
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 5th May 2007, 08:58 AM

Posting Permissions

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