Touch to Go and Stop

BluSpyderBluSpyder Member Posts: 129
edited November -1 in Working with GS (Mac)
In my game i have actors that you can touch to go or stop. I have somehow made it sort of work, but you have to tap on multiple times to stop and multiple times to go. They are kind of like jumpy. If you tap them to stop, it will stop for a split second and then go again, same if you try to make them go they will go for a split second but then stop again. So you have to tap it multiple times for it to work, and they will continue their motion or stop without having to touch more.

What i have set is: I have a boolean attribute_motion, set default to true so that when they randomly spawn they are moving. Then my first rule is
----If attribute_motion is true, then animate the actor with the images and set velocity speed to 73 blah blah.
----My next rule is If actor receives touch pressed AND attribute_motion is TRUE then change attribute_motion to FALSE and change velocity speed to 0, OTHERWISE If actor receives touch pressed AND attribute_motion is FALSE, then change attribute_motion to TRUE and change velocity speed to 73.

After that i have a collision rule where if they collide with another actor then set motion to 0, which works ok right now.

With those settings, the actor SORT OF works, but like i said, it will sometimes take 2-3 touches to get them to stop or go. And even sometimes if i hold down the touch they will skid across the screen with no animation of the the images too. I'd appreciate some help if anyone has experience with this.

Comments

  • BluSpyderBluSpyder Member Posts: 129
    Anyone?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I've done it a slightly different way:

    Rule: When touch is pressed
    Rule within above: When Attribute scene.motion is false
    change attribute scene.motion to true
    change attribute self.Motion.Linear Velocity to 73
    otherwise
    change attribute scene.motion to false
    change attribute self.Motion.Linear Velocity to 0

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • BluSpyderBluSpyder Member Posts: 129
    no luck. didn't work. :/
  • rlehmrlehm Member Posts: 320
    When you open gamesalad, in the tutorial examples area, type platformer or other keywords like that and you'll find living examples of what you need. You'll likely find other useful things to add to your game :)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Wingnology said:
    no luck. didn't work. :/

    No way it can't not work (working fine in my small test); maybe you put stuff in the wrong otherwise.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • BluSpyderBluSpyder Member Posts: 129
    Thanks for the help guys. I finally got it to work by using self_motions and using the layout that you gave me gyroscope, except it wouldn't work with the attribute for some weird reason, so i changed the attribute to just If self_motion is 73 when touch is pressed then change self_motion to 0.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Wingnology said:
    Thanks for the help guys. I finally got it to work by using self_motions and using the layout that you gave me gyroscope, except it wouldn't work with the attribute for some weird reason, so i changed the attribute to just If self_motion is 73 when touch is pressed then change self_motion to 0.

    That is strange; glad you sorted it and I was some help anyway. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.