How do I implement "select case" or "if .. else if...else."

Get help using Construct 2

Post » Tue Oct 20, 2015 7:03 pm

I have a global variable that increases from value 1 to 7 .
Based on the value, First a set of sprites is generated and the animation frame numbers are set for each sprite generated .
Second, I want to load some strings into a specific array in each case.
The array contains names of audio files to be played when user clicks on the sprite .
Error :
Sprites are generated for each set but audio plays only for first set.

Possible points of error
1. variable not increasing in value = > no because the sprites to be generated are correct for each value of variable
2. array not loaded with file names => no because the audio plays correctly in first set of audio files(not possible unless audio file names correctly loaded).
3. code to play audio is not right => no because the audio plays correctly in first set of audio files.
4. the system -- compare variable to value 1 -- actions ; else compare variable to value2 -- actions is not working correctly.
How do I implement his ?
B
6
Posts: 16
Reputation: 296

Post » Tue Oct 20, 2015 7:36 pm

Would it be possible for you to share your events/capx?
Unless you'd like people to guess..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 20, 2015 8:02 pm

@LittleSatin ,

I found a solution using

event condition1....action 1
else
event condition2....action 2

https://drive.google.com/file/d/0B_3gk1SvtQWVSlB0T2FhRnZnNEk/view?usp=sharing
B
6
Posts: 16
Reputation: 296


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Jackriduk, NN81 and 37 guests