do and undo with same condition

0 favourites
  • 10 posts
  • Hi again,

    Topic's subject is meaningless, sorry, but here is the explanation:

    I want to use touch input to change grid frames but also to undo these changes. When we touch an untouched grid this one will change color but when we go that path backwards they will turn their original frame, that's what I want to make.

    I know the events below are obviously wrong but I put this here to learn how to avoid this mistake.

    <img src="" border="0" />

    thanks in advance.

  • ebrar

    May be you could add 2 instance variable on your grid object one for the new state and a second one for the old one.

    Not sure I understood well your issue...

  • Thanks beufreecasse,

    Sorry for my bad explanation. I'll try again. If still not understood please don't hesitate to demand further explanation.

    When player touches a grid, grid's color changes. I want to set its original color back when player touches again this colored grid.

    here is the capx, but i think that won't help much. (comments are not in english too)

    As to your advice, if i add instance variables i think touch condition will change them continously as long as grid is touching. But maybe I am wrong.

  • thanks shinkan but you used "on touched"

    I want to make it with "is touching"

    As you can see in my capx, player can draw a path by sliding his finger, and I want him to delete this path by sliding over it again. without need to separate his finger from screen (or releasing mouse button).

    I hope that was clear :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Excuse me gentlemen, but I am afraid I will....


  • Here is an ugly solution. touch path

    Not perfect, but you should get the idea. It's done with two variables and single else branch.

  • thanks vee41 but I am getting an error 400 from dropbox

    "Error (400)

    Something went wrong. Don't worry, your files are still safe and the Dropboxers have been notified. Check out our Help Center and forums for help, or head back to home."

  • ebrar Sorries, fixed it.

  • vee41

    thanks again. I'll try this.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)