Slow Actor From Falling

Currently right now, i have actors spawning from the top of the screen by the timer function. I want to be able to change the speed that they are slowing down as they get the "power" to do so. So all the current actors that have spawned and will spawn to slow down. And after x amount of time, they change back to normal speed.

How i'm spawning the actors
http://imgur.com/dJRs5Oo

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Create a boolean attribute called game.slowDown. In an actor, have a rule that changed game.slowDown to true based on some condition (and then back to false on some other condition or after a certain amount of time using a timer). In the spawned actors, have a rule that changes their speed to one value if game.slowDown is true and another if it's false.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SopandaSopanda Member Posts: 21

    @tatiang said:
    Create a boolean attribute called game.slowDown. In an actor, have a rule that changed game.slowDown to true based on some condition (and then back to false on some other condition or after a certain amount of time using a timer). In the spawned actors, have a rule that changes their speed to one value if game.slowDown is true and another if it's false.

    So i tired what you told me, so far the only thing that needs working on is that, only the first actor that hits it only slows things down, anything after that, the slowDown doesn't apply anymore and they just go normal speed.

  • imjustmikeimjustmike Member Posts: 450

    Post your rules. What @tatiang‌ described should work, so maybe there's an error in your behaviours.

  • SopandaSopanda Member Posts: 21

    @imjustmike said:
    Post your rules. What tatiang‌ described should work, so maybe there's an error in your behaviours.

    Here is the file. http://www.mediafire.com/download/t1txbhz61ezh5pj/SlowMo_Test.zip

    I've tired working it out but it seems to only apply to the first actor that spawns and any following actor, the effect doesn't work on it.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited December 2014

    @Sopanda,

    I tested an update to your project and got it working like I think you are asking, here is what to do:

    1. Don't use gravity, make that 0
    
    2. Update the ball rules like this (delete what you have):
    
    Rule: When game.SlowMo is true
    Move Behavior: Direction 270 » Speed: 100 » Relative to: Scene
    Otherwise:
    Move Behavior: Direction 270 » Speed: 200 » Relative to: Scene
    
    3. Update the button rule like this (delete what you have):
    
    Rule: Actor receives event » touch » is » inside
    Change Attribute: game.SlowMo » To: true
    Otherwise:
    Change Attribute: game.SlowMo » To: false
    

    I'd send you the project but I'm on a mac and I don't think the windows version will open it.

  • SopandaSopanda Member Posts: 21

    @jamie_c said:
    Sopanda,

    I tested an update to your project and got it working like I think you are asking, here is what to do:

    1. Don't use gravity, make that 0
    
    2. Update the ball rules like this (delete what you have):
    
    Rule: When game.SlowMo is true
    Move Behavior: Direction 270 » Speed: 100 » Relative to: Scene
    Otherwise:
    Move Behavior: Direction 270 » Speed: 200 » Relative to: Scene
    
    3. Update the button rule like this (delete what you have):
    
    Rule: Actor receives event » touch » is » inside
    Change Attribute: game.SlowMo » To: true
    Otherwise:
    Change Attribute: game.SlowMo » To: false
    

    I'd send you the project but I'm on a mac and I don't think the windows version will open it.

    Thanks for the rule and everything. I got everything to work. I tired to add a timer to the button rule, but it only worked if i held onto the button instead of just clicking it and changing back to false after the seconds. Do i need to make a custom timer?

    Along with the touch i had
    Timer: For 5 seconds > Change Attribute: game.SlowMo > True

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    you don't need a timer if you set the rules up as indicated, do you specifically want it to work on a timed basis?

  • SopandaSopanda Member Posts: 21

    @jamie_c said:
    you don't need a timer if you set the rules up as indicated, do you specifically want it to work on a timed basis?

    I got it figured out. Thanks for your help!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
Sign In or Register to comment.