ok so i want to make a game which uses a rub technique like this game
so say that that rub actors on the screen 3 seconds i want to make it so the faster you rub for that 3 seconds the faster my other actor will go is there a way to do this ?
@tatiang thanks for clearing that up for me also if you look at the image i suppliced would i need to apply all that the actor RUB or the Actor thats moving cause i want to rub the Rub actor and from that i want the other actor eg a bike to move ?
@RThurman thanks for clearing that up for me also if you look at the image i suppliced would i need to apply all that the actor RUB or the Actor thats moving cause i want to rub the Rub actor and from that i want the other actor eg a bike to move ?
You might put the result (self.averageRubSpeed) into a game attribute instead (game.averageRubSpeed) and then use it to formulate the bike speed.
For example in the bike actor you could have: Constrain Attribute: self.velocity X To: game.averageRubSpeed*.25
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
edited February 2013
@Jordeyy to be honest, RThurman is your best bet for help since he's a our resident math expert. I was just commenting on the fact that rules referring to "mouse" work just fine on a touch device. I actually don't understand your question the way you wrote it. Too much of a run-on sentence. But if you're patient I'm sure RThurman will get back to you.
Comments
When MouseDown
--Timer (every 0 seconds)
----Change Attribute: self.rubSpeed To (self.rubSpeed *.96)+(abs(game.Mouse.Position.X-self.oldX )/(self.Time-self.oldTime )*.04)
----Change Attribute: self.averageRubSpeed To: (self.averageRubSpeed +(self.rubSpeed/9))*(.9)
----Change Attribute: self.oldTime To: self.Time
----Change Attribute: self.oldX To: game.Mouse.Position.X
You would need to make four self attributes -- all of type real:
rubSpeed
averageRubSpeed
oldTime
oldX
Also, you can't simply copy and paste in the equations. They need to be built with the expression editor.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
For example in the bike actor you could have:
Constrain Attribute: self.velocity X To: game.averageRubSpeed*.25
Edit: et voila!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@RThurman Thanks the way you said worked thanks alot