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

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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.

    Please login to see this link.

    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.

  • here is a solution "s" to save, "z" to restart without restart frame "r" restart frame
    Please login to see this attachment.

    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!

  • it is because there is 2 loop named "old dots", rename fore exemple the loop after the reboot and it works.
    Please login to see this attachment.

    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! :)

  • it is because there is 2 loop named "old dots", rename fore exemple the loop after the reboot and it works.
    Please login to see this attachment.

    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. (?)

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!