How do I associate specific sound to each sprite in a family

Get help using Construct 2

Post » Tue Dec 09, 2014 12:31 pm

Hello,

I try to make a little game and I have some problem due to lack of knowledge (I'm a beginner), so I really hope you can help me, and in advance thanks for your time and conseideration.

Well let's go I have a family of "enemies" set:

-enemytype1
-enemytype2
-enemytype3
....

I have imported in "sound" some m4a files:

-enemytype1sound.m4a
-enemytype2sound/m4a
....

I want to spawn a random enemy each type so i've did each 2 seconds spawn "enemies" on layer 2
"enemies" is the family group.

So my question is when the game random pick an enemytype from the "enemies" family how do I play the corresponding sound when the sprite spawn on screen ?

Thanks again I hope I'm clear

NG
B
3
Posts: 8
Reputation: 189

Post » Tue Dec 09, 2014 5:40 pm

I don't know much about Families :D
but you can always use something like...

On created enemytype1 .Play -enemytype1sound.m4a..

On created enemytype2 .Play -enemytype2sound.m4a......
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue Dec 09, 2014 6:25 pm

store the sound name in a variable on the sprite, then play the sprite variable name when you want to.
Some games: https://play.google.com/store/search?q= ... s&hl=en_GB Feel free to show the panda some support, he would appreciate it :)
B
19
S
5
G
1
Posts: 155
Reputation: 1,619


Return to How do I....?

Who is online

Users browsing this forum: mindragon73 and 17 guests