User Tag List

Results 1 to 7 of 7

Thread: How to recreate the number of objects remaining and in the same position as before?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    283
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to recreate the number of objects remaining and in the same position as before?

    Hi everyone.
    We already know that the method to get back the same number of objects left on the screen after a life is lost is: Start loop "Create object" number alterable value. Then: Set X ("Object") + (LoopIndex ("Create object") * 8). To go to new line reached a coordinate greater than x 200 (for example): Set X ("Object") + (LoopIndex ("Create object") - 208). And then Set Y position to Y ("Object") + 8
    An example is Pac-Man: when the frame restarts after you lose a life, the same number of dots remaining and in the same positions reappear.
    As long as there is only one frame for a player, the problem is solved by recreating the objects at the xy positions without restarting the frame.
    But what method should be used to make sure that the remaining objects are repositioned in the same previous XY coordinate?
    I know that the X and Y positions of each single object can be stored in an Array or in a Layer object.

    Download the example here.

    In the file.zip there is the complete game, and to give the idea, there is the example described above, named: "Loopindex create dots.mfa"

    Note: the google chrome browser warns that the file may be threatening or recognizes it as a virus. But I tried to re-download it and checked it with the antivirus software and there is no threat, also because the files are made with the C.T.F. 2.5 original.

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2018
    Posts
    585
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    here is a solution "s" to save, "z" to restart without restart frame "r" restart frame
    Puck-Man Loop index create dot TEST.mfa

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    283
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredetmumu View Post
    here is a solution "s" to save, "z" to restart without restart frame "r" restart frame
    Puck-Man Loop index create dot TEST.mfa
    Thanks 1000 for setting the example. I didn't get there. Meanwhile, I realized that when using the Array you must always save the content in an external file. I tried it and started studying the events you replaced.
    I saw that the result I wanted is there! But it happens only once if I press "S" (to write the values of the number of dots in the Array) and then "R" to restart the frame (and in fact the same number of dots remaining and in the same XY positions as before reappear) .
    On the second reboot after pressing "S" (and after eating more dots of course), it is no longer happens!
    But it is not easy, there will still be a lot of study to be done.
    You were great Fredetmumu!

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2018
    Posts
    585
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    yes there is a bug when you press strat 2 or 3 times, i will correctr it later

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2018
    Posts
    585
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    it is because there is 2 loop named "old dots", rename fore exemple the loop after the reboot and it works.
    Puck-Man Loop index create dot TEST2.mfa

    PS: if you don't reboot the frame it's not necessary to reload the arrays

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    283
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredetmumu View Post
    it is because there is 2 loop named "old dots", rename fore exemple the loop after the reboot and it works.
    Puck-Man Loop index create dot TEST2.mfa

    PS: if you don't reboot the frame it's not necessary to reload the arrays
    Great work! You have been a genius. Later I will study how to split the event for the 4 pills and how to copy and paste the events into my pacman (replacing pressing the "S" key with the collision - loss of life - sprites!)
    Another thing I noticed (but in the events I wrote) is that the dots are 224 at the time of association with the alterable value "number of dots"! Instead the dots should be 240!

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleUnicode Add-on
    daryuss's Avatar
    Join Date
    Apr 2012
    Location
    Italy
    Posts
    283
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredetmumu View Post
    it is because there is 2 loop named "old dots", rename fore exemple the loop after the reboot and it works.
    Puck-Man Loop index create dot TEST2.mfa

    PS: if you don't reboot the frame it's not necessary to reload the arrays
    Hi friend.
    I have thought of another method to solve the remaining dots problem.
    I added two more alterable values: AA - save dots number p 1 and AB "***********".
    I added two more frames: Save dots frame p1 and "***************" p 2.
    In these two frames there are already 240 dots in their correct positions (lockeds), so the alterable value "AA -save dots" is set to the number of dots and their XY positions are saved in the two arrays.
    Then, when it jumps to the player's frame, he begins the loops create the dots associated with the arrays.
    When the player loses his life, the frame restarts. On the other hand, when the player completes the level, he returns to the "save dots p 1 frame" (when the game over event group is deactivated, when activated it would be sufficient to deactivate the restart frame events group and the subtraction of lives events group).
    If this method succeeds, there would be no need to create external files just for the dots.
    But I noticed that arrays cannot be made as global objects. (?)

    Download here.

Similar Threads

  1. Version number of save frame position
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 11th November 2020, 09:44 AM
  2. Looking for: Shader to recreate water surface obj
    By fandelfinger in forum Hardware Accelerated Runtime
    Replies: 19
    Last Post: 12th July 2011, 02:08 PM
  3. What's the version number of Save frame position?
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th May 2011, 08:57 AM
  4. Glitch - Deleted Actives Don't Recreate.
    By BrandonC in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 12th December 2008, 12:49 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
  •