do and undo with same condition

Get help using Construct 2

Post » Mon Apr 22, 2013 11:37 am

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.



thanks in advance.
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Post » Mon Apr 22, 2013 5:50 pm

@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...
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Mon Apr 22, 2013 7:04 pm

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.ebrar2013-04-22 19:05:32
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Post » Mon Apr 22, 2013 7:16 pm

touch change color.capxshinkan2013-04-22 19:17:02
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Apr 22, 2013 7:30 pm

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 :/
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Post » Tue Apr 23, 2013 2:19 pm

Excuse me gentlemen, but I am afraid I will....







BUMP THIS.
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Post » Tue Apr 23, 2013 2:38 pm

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.vee412013-04-23 14:47:21
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Apr 23, 2013 2:45 pm

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."
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Post » Tue Apr 23, 2013 2:47 pm

@ebrar Sorries, fixed it.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Apr 23, 2013 3:10 pm

@vee41

thanks again. I'll try this.
B
14
S
4
G
3
Posts: 101
Reputation: 3,499

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet, Scofano and 17 guests