Help with doodle game control
goliath
Member Posts: 1,440
Hey guys, I am sorry to ask this as I am certain it's an easy fix (although nothing is easy right) but I am currently using toastkittens excellent doodle jump template and I can't figure out how to control the actor using the phones accelerometer.
I am guessing that a constrain attribute would be the most responsive, I just need a little help with this and I will be on my way. Again, sorry for the (hopefully) easy question, I still feel like I have so much to learn. Thanks guys.
I am guessing that a constrain attribute would be the most responsive, I just need a little help with this and I will be on my way. Again, sorry for the (hopefully) easy question, I still feel like I have so much to learn. Thanks guys.
Comments
If accelerometer x > 0.1
constrain attribute self position x to self position x + whatever
Constrain Attribute: self.Motion.Linear Velocity.X
TO: game.Accelerometer.Y*500
If you're holding landscape:
Constrain Attribute: self.Motion.Linear Velocity.X
TO: game.Accelerometer.X*500
If the actor is going in opposite direction for any of these, just change 500 to -500
Hope this helps!
Thanks