Question about speed decreasing.

CaptainXCaptainX Member Posts: 14
edited November -1 in Working with GS (Mac)
Hello there,

I would like to know if it’s possible when I pick up an object the character speed will decrease?

I move the character while pressing on him.

Rule :
Actor receives event : touch : is pressed
Constrain Attribute : self.Position.Y to game.Mouse.Position.Y (I’m using the mouse right now to test the game and the char. only move up and down)

so when I get an object I want to decrease hes speed.... how?

thank you.

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    1st you do not need to constrain to mouse... Constrain to touch position... which may alleviate possible play problems after a build. (all touch commands are interpreted by the mouse in GameSalad... and the Devices/mouse is used in web or desktop builds)

    I don't really understand the problem...
    if actor is constrained to touch location... then actor's speed is the speed of the user's drag.

    Unless you want to offset that.

    could you explain in more detail?

    MH
  • CaptainXCaptainX Member Posts: 14
    Thank you for your advice concerning the touch commands,

    I sent you a private message for my problem.

    thanks !
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    when actor overlaps with whatever you want to change speed change attribute motion to whatever you want.
  • CaptainXCaptainX Member Posts: 14
    What I've done is create an attribute named "Speed" integer at 0. (I'm really not sure if it's a good start)

    In my rule, i've put when the actor overlaps with an object :

    change attribute
    self.motion.linear velocity.y to game.Speed - 10 (-10 will move slowly down + 10 slowly up) I'm sure this is not good too since I want my character going slowly whenever I decide to move him up or down by touching the screen, right now he's moving by himslef without the player touching him to move...

    :(
  • CaptainXCaptainX Member Posts: 14
    Simple question : It is possible to change the speed of dragging something on screen? Or whatever the user drag something on screen it will be the speed of the user? so we cannot change this?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yes if your interpolating the position to touch 1 it should move as fast or as slow as your finger does.
  • CaptainXCaptainX Member Posts: 14
    but if I want to force the user to move slower can I ? even he he move hes finger fast...
  • MotherHooseMotherHoose Member Posts: 2,456
    you could show them a "Yellow Light" and tell them to slow down.

    you could offset the constrain to X or Y by -10 or so... but that doesn't slow it... just follows the moving finger.

    MH
Sign In or Register to comment.