sound question

artfishartfish Member, PRO Posts: 369
edited May 2012 in Working with GS (Mac)
Hey everybody. Should be a simple answer here, but for some reason I'm struggling.

I have an accelerometer minigame that opens a door in my game. I want to have my "ball is rolling" sound play while actor is in motion.

when attribute-?- is greater than ? - play sound.

Anyone?

Thanks everybody!

Eric

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    take the self.position.x out and instead constrain self.motion.linear x. You might want to change the *17 to something higher like *400 or something like that.

    See how that movement is, cause then the sound rules will work.

Answers

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make a rule with 2 condtions. Change it to when any condition is valid, instead of all.

    When self motion linear x does not equal 0
    When self motion linear y does not equal 0
    -play sound
  • artfishartfish Member, PRO Posts: 369
    @JohnPapiomitis Thanks Dude!
  • artfishartfish Member, PRO Posts: 369
    edited May 2012
    @JohnPapiomitis. Hey John. Just tried it. no sound. arghh... SO here's what I have
    Rule
    When any conditions are valid
    attribute:self motion linear velocity Y does not equal 0 and another condition, attribute:self motion linear velocity x does not equal 0
    -playsound.

    hmm...

    Thanks
    Eric
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited May 2012
    Not sure why its not working for you, it works fine for me. Check loop and uncheck run to completion if you didnt already.

    Heres a demo: http://www.mediafire.com/?0dw8nlidl867wvn
  • artfishartfish Member, PRO Posts: 369
    Thanks for you help @JohnPapiomitis. I have loop checked and run to completion unchecked.
    I really appreciate you taking time to help. Are there any other factors that could be preventing it from playing? I have other sounds in the scene that play fine when the actor overlaps them.

    I've also tried changing the sound effect as well. nothing.

    Eric
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    what are the rules your using to move the ball?
  • artfishartfish Member, PRO Posts: 369
    That's kind of what I'm wondering.

    Constrain self.positionx to self.Position.X -( game.Accelerometer.Y *17)

    Thanks.
  • artfishartfish Member, PRO Posts: 369
    maybe my actor is not really "moving" just giving the appearance of moving.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yeah thats why. Its cause you constraining its position, so its linear motion is always 0.
  • artfishartfish Member, PRO Posts: 369
    It there a viable alternative using the rules I have or should I switch the controls to an accelerate behavior. I was just having a problem calibrating using accelerate so I switched to this rule which is very smooth...

    Thanks Master @JohnPapiomitis
  • artfishartfish Member, PRO Posts: 369
    I'll try that. Thanks
  • artfishartfish Member, PRO Posts: 369
    @JohnPapiomits You are the Man. I'm totally sending a Promo code to you when I release it this fall!

    Thanks for your help, yet again!

    'till next time

    Eric
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    No problem, glad i could help.
Sign In or Register to comment.