Changing acceleration speed.

masterfarmasterfar Member Posts: 2
edited November -1 in Working with GS (Mac)
Hi, what iam tryin to do is to get an actor to run, and the faster the actor is tapped on the faster i want him to run. Ive looked everywhere for information on this but just cannot figure it out. If any1 can give me the solution to this or som info it would be greatly appreciated thanks

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    You could do something like this;

    Rule:
    When actor is pressed and inside;
    Change attribute Max Speed to Max Speed+10
    Change Attribute self.linear velocity.X +10

    To slow the actor down you could include either friction on the things he's running on, or on the actor itself.
    Or you could use a timer or something: for every 5 seconds;
    Change Attribute Max Speed to Max Speed-10
    Change Attribute self.linear velocity.X-10

    Hope that works for ya.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Touch is Pressed and inside is not needed.

    Only touch is pressed

    The touch is inside condition is different than touch is pressed and also completed negated when you add it with touch is pressed. its just something extra the game engine has to read ever time it reads that rule.

    I would actually do something like

    When touch is pressed
    --Accelerate at at a speed of 300 (play with that number to get it how to want it. )
    Otherwise
    --Constrain attribute self.linearvelocity.x to (self.linearvelocty.x*0.95)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    tenrdrmer said:
    Touch is Pressed and inside is not needed.

    Only touch is pressed

    The touch is inside condition is different than touch is pressed and also completed negated when you add it with touch is pressed. its just something extra the game engine has to read ever time it reads that rule.

    +1
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    The only issue I see with what I suggest with using the accelerate behavior is someone could hold down on the actor and it keeps accelerating. If thats an issue you may want to do a use Change Attribute self.linearvelocity.x to self.linearveleocity.x+100 in place of the accelerate. Lots of ways you could probably achieve this.
  • masterfarmasterfar Member Posts: 2
    I will give it ago, thanks for all your suggestions. Will post wat finally worked out for me
Sign In or Register to comment.