User Tag List

Results 1 to 2 of 2

Thread: Need help for an Undo feature for my game

  1. #1
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Location
    Umeň, Sweden
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help for an Undo feature for my game

    First off, sorry if this is in the wrong place.

    Alright, so I'm making a grid-based Sokoban inspired puzzle game. And I want to so you can go back in time by pressing undo as many times as you want.
    For every time you move, or push a box around, the game records how many times you've moved so I need it so for every move, the game saves X and Y positions of all my objects.
    I tried using INI, Array, Save Game, and I tried giving them unique ID by using Spread Value, but I have no idea how to do this!

    I uploaded the .mfa file (using MMF 2.0) so you can download it and look at it, and you can add it in and send it back.
    Telling me how to do it here without doing that is cool too of course, but I have loads of explanations on how my engine works in the file:
    http://s000.tinyupload.com/index.php...62358418570275
    http://www8.zippyshare.com/v/96440116/file.html

    In case you don't wanna download the .mfa, this is how I want it to work:
    So the red dot is you and the orange ones are movable objects.
    It starts at 1. Then you move to the right, this is turn 2.
    At turn 3 you move you go up and move the orange object at the same time.
    Then you decide to undo and go back to move 2. Then undo again and you're back to 1.


    Thank you!

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,398
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    As long as you don't have any kind of chain reactions going on, you don't need to save the whole frame. All you need to save is the direction in which the player moved, and the contents of the square directly in front of them before they moved.

    If you really do want to save the whole frame, then just save it as a regular 2-dimensional array (there are already loads of examples of that if you search), and use the 3rd array dimension for "time". Every time the player moves, increment the Z axis by 1; every time they undo, decrement it by 1.

Similar Threads

  1. What would this game feature be called?
    By ratty in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 23rd August 2012, 01:07 AM
  2. Ini++ Update: 'Undo' feature
    By Jax in forum Extension Development
    Replies: 6
    Last Post: 8th October 2010, 08:52 PM
  3. Undo Bug: resizing objects doesn`t undo
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 3rd March 2007, 09:55 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
  •