'Random' Question
HI All,
In my game I have 7 coloured Blocks that randomly spawn from the top and land on the bottom(Tetris style). However i also need to have a random (of 7) sound playing for the duration that the block is falling.
I'm not sure where to put the rules.ie in the blocks,the spawner or the sounds.
Hope this makes sense!
In my game I have 7 coloured Blocks that randomly spawn from the top and land on the bottom(Tetris style). However i also need to have a random (of 7) sound playing for the duration that the block is falling.
I'm not sure where to put the rules.ie in the blocks,the spawner or the sounds.
Hope this makes sense!
It’s not a bug – it’s an undocumented feature
Best Answer
-
tenrdrmer Posts: 9,934
Ok a little forum etiquette man. Why are you rejecting answers that solve your problem. Yes you may have more answers but that doesn't mean reject the answer that helps you. you just keep posting your questions.
And dont loop the sound or have a long sound file and it will just play once. If you must though build a rule around the entire sound rule that say something like when linearvelocity.Y is < 0 or something.
Answers
Change self.sound to random(1,7)
then a rule
When self.sound = 1
play sound 1
-Otherwise
-When self.sound = 2
-Play sound 2
--Otherwise
--When self.sound = 3
--play sound 3
---Otherwise
--- And so on all the way to 7
How can I make it so the sound only plays when the block is falling?
It’s not a bug – it’s an undocumented feature
I asked in the original question for the duration that the block is falling. This wasn't answered so I chose not to press 'accept' so people wouldn't think that my problem was solved and not bother looking, OK
I n what way is this bad etiquette?
I mean I thanked you for you answer and all.
Cheers
It’s not a bug – it’s an undocumented feature
panicked!
I didn't mean to brand you as a reject or anything. :-\"
It’s not a bug – it’s an undocumented feature