Navigate a falling object left/right with buttons
Ok so I have a bouncing object and I want it to move left/right naturally using control buttons. Any help would be appreciated.
So far I set up some attributes to control the actor but it's just not acting naturally.
Thanks
So far I set up some attributes to control the actor but it's just not acting naturally.
Thanks
Comments
Make two attributes
Mright
Mleft
In the buttons, when press, mright = true
Otherwise mright = false
In the falling actor
If mright =true
Change attribute self.motion.velocity.x = a number here
Do the same for the other button, remember it'll have a - number
Away from game salad so this is all on memory, sorry if it's wrong
velocity.x=velocity.x *[some modifier like 1.25]
that way if it's moving sideways already for some reason, it won't slow down when you're trying to speed it up, which could happen if you chose a low static num. And you can set a max of course. good luck