Game Sound ON/OFF Button Issue

Get help using Construct 2

Post » Sun Nov 13, 2011 6:56 pm

This could be considered generic too, It's about interchanging position of two objects when clicked.


So as per the image,

When Game starts...
on_layout2 - is a sound ON button placed on visible screen area (136,370).
off_layout2 - is a sound OFF button placed outside visible screen (-127,370)

What I wanted to do...
1. When User clicks on on_layout2, the object should move to position of off_layout2(-127, 370) and off_layout2 should move to visible screen (136, 370)

2. When User click on off_layout2 that is now on visible screen, it should move to position of on_layout2 (-127,370) and on_layout2 should move to visible screen (136, 370)

Action 1 works, but when I add the 2 action it doesnt work.
The object on_layout2 just stays there.

I have also tried putting in positions instead of using "move to position of another object"
Same result.

Been cracking my head over this past hour.

Any suggestions. Help?

Thank you,
Krishkrish2011-11-13 18:58:22
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,627

Post » Sun Nov 13, 2011 9:06 pm

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Feb 11, 2013 2:33 pm

Thanks
B
10
S
3
Posts: 69
Reputation: 1,590

Post » Mon May 13, 2013 11:59 am

@Kyatric

Thanks for share but when I refresh my browse or enter in second level it again go to in on mode or Animation Frame to 0..

How to resolved this issue I thing if we store our value in array than we solved this issues do you have any sample which store there value in array

B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Post » Mon May 13, 2013 12:18 pm

@rob: why bother with arrays when all you need is a global variable ?
MySpriteButton_Layouts
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon May 13, 2013 12:28 pm

@Kyatric,

Thanks for the quick response,

But again got same issues..

which sample file you send me I have checked that when I was in level 1 I set animation frame-0, and click ok after click ok button it go to in level 2 but again it show me animation famre-1, which is default but My question is that when I have set it in animation frame 0 then when i go to in level 2 it should in same on there(animation frame 0 not animation frame 1).............

B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Post » Mon May 13, 2013 12:48 pm

@rob: indeed I had forgotten an action.
Download the sample again, it's working as intended now.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon May 13, 2013 1:21 pm

Nice example @Kyatric, I also usually use the local WebStorage to remember these user choices
B
123
S
19
G
16
Posts: 487
Reputation: 21,498

Post » Mon May 13, 2013 1:44 pm

@gillenew: it's indeed the next logical step.
You get the value from the webstorage in the very first layout of your project and each time the user changes it, you set the value to the global variable (for the current game) and save it in the webstorage too.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Tue May 14, 2013 8:21 am

@Kyatric,

Thanks Kyatric it working fine My first issue has fixed but when I refresh my browser it again go to in animation frame 1 if I set in animation frame 0. so how can set it..

B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Next

Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Google [Bot], Matthew de, Skebab and 5 guests