Driving me crazy, please help!
bladeolson
Member Posts: 295
So I have come quite way with my game but an important part is driving me nuts.
I am using the accelerometer to control the left right movement of my guy. It works great. I am changing the velocity depending on which direction you move the accelerometer. My guy jumps up and as I move the accelerometer he will move in that direction, but when I switch to the othe direction he moves the other way, but it is too slow. meaning he needs to compensate for the X movement before he can begin moving the other way. Is there a way to "slam on the brakes" when I switch directions? I tried setting up some rules but was getting lost.
Any help would be appreciated.
I am using the accelerometer to control the left right movement of my guy. It works great. I am changing the velocity depending on which direction you move the accelerometer. My guy jumps up and as I move the accelerometer he will move in that direction, but when I switch to the othe direction he moves the other way, but it is too slow. meaning he needs to compensate for the X movement before he can begin moving the other way. Is there a way to "slam on the brakes" when I switch directions? I tried setting up some rules but was getting lost.
Any help would be appreciated.
Comments
Or...
when myGuy is "movingRight"...and I say "moveLeft":
changeAttribute self.velocity.X = 0
after X seconds,
accelerate "leftAccelerationValue" in the "leftDirection"
May I ask, what is the reason for the "after X seconds,accelerate "leftAccelerationValue" in the "leftDirection" " ??
I recommend about .25 seconds in that timer.
If you are clever...make the pause about 1 second and insert a 1 second long animation in that time gap of the character "hitting the breaks and turning around...giving more "experience" in the game and making it a little more realistic...than just a stop. Animate that immediate momentum reversal....like a "whoooohh Crap!" looking effect.
This logic sequence I described previously is as if you are running right and then decided to turn around and run left. If the intended sequence was to simply stop...then you don't need the timer and the reversal part....but a cool "quick stop" animation would be fun!
I like the idea of adding an animation to make it look like he is slowing himself down. One thing I did that was cool instead of going to a velocity of 0 , I set it to 100, so the guy kinds of floats into a stop when jumping. it looks and feels great.