Buttons/Sprites not working as expected

Get help using Construct 2

Post » Wed Mar 23, 2016 11:47 pm

Hi everyone,

So I'm just about ready to publish and share my game around various places, the game itself works really well apart from.... the sound buttons don't seem to want to work.

I am aiming for two buttons on my main menu screen, one for music, one for general sound. When the user clicks/taps the button, it will stop the audio (bg music or general respectively) and a cross appears in front of the button. Then when they click/tap it again it will uncross the sprite and either start the bg music up again or simply allow the sfx to play during the game.

I've got the buttons in place, I'm trying to switch to a second animation frame on click to show the cross on each one. Problem is nothing much else works.

It might be a lot easier to show you what I mean, so if anybody could take a look at the below capx file and suggest where I've ballsed up that would be AMAZING.

Ball Game capx

It's not the easiest set of pages to navigate, but the sound button events are on the menuEvents page, at the bottom.

Any help or suggestions would be so welcome, I'm pulling my hair out here!
B
7
Posts: 20
Reputation: 317

Post » Thu Mar 24, 2016 12:05 am

try:
Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Mar 24, 2016 12:14 am

That's perfect, and such a quick reply too, thank you so much Korbaach, much appreciated!!!!
B
7
Posts: 20
Reputation: 317

Post » Thu Mar 24, 2016 12:55 am

Here's an even quicker solution:

On musicButton clicked:
Set musicMute to 1 - musicMute
musicButton - set animation frame to musicMute
B
32
S
14
G
6
Posts: 163
Reputation: 5,835

Post » Thu Mar 24, 2016 1:05 am

korbaach's solution is better as it allows the user to toggle the button, where the other solution only sets the button once.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests