Jump to content


Photo

Sound Electro-problem


  • Please log in to reply
2 replies to this topic

#1 M Volcan

M Volcan

    GMC Member

  • New Member
  • 38 posts

Posted 23 July 2006 - 02:38 AM

hi :)

  I'm making a small Electroplankton remake and I need to make my plankton object to choose a random sound when it collides with the leaf, but I can't find a way to do it. I know I can make one Plankton object for each sound, but I need it to play a random one each time it hits a leaf.

  Please help me!
  Thanks! :)
  • 0

#2 Grak

Grak

    GMC Member

  • New Member
  • 120 posts

Posted 23 July 2006 - 05:14 AM

Make a variable on creation of each leaf. call it whatever.
Creation of Leaf:
Whatever = choose(sound1,sound2,sound3);

in Plankton- collision with Leaf:
sound_play(Whatever);

That should work.
  • 0

#3 M Volcan

M Volcan

    GMC Member

  • New Member
  • 38 posts

Posted 23 July 2006 - 03:45 PM

Nope. that would choose a sound, and then, each time a plankton collides with a leaf, do always the choosen sound. I need it to be random EACH TIME it hits a leaf :P

EDIT: thanks! :GM028: I've modified what you said a little: I've put the sound choose in the step event of the plankton, so it will be changing sounds every step. thanks again! :)

*SOLVED*

Edited by M Volcan, 27 July 2006 - 12:52 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users