Touch to Go and Stop
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.
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
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
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps