1
Graphics / Re: [Help] An Isometric Movement Code
« on: October 27, 2014, 03:15:54 am »
Sorry, but you missunderstood me. I have wrote several codes, and worked with several alternative logics. All I want from here is for a "light" to understand how to deal with the "sprite-changing problem". I really don't want a code just to copy it, since I'm working on this project for educational matters.
It's like this: I had a acceleration functionable code, working as the physic's logic. My problem was that my sprite don't rotate, it only changes the sprite's frame when a key Up or Down is pressed. I deal the rotation considerating that instance's frame as the angle the car. The deal with it was that when the player presses the key "Up" or "Down", the method that changes the sprite is active as long as the key is pressed, so the top-speed for that position of the frame doesn't change and the car will continue to speed like it haven't change the sprite, like a "drift". I'm okay with the car drifting, since it do it too in the original game, but my car drifts for as long as the key is pressed, resulting in cases when it is facing right and still moving left.
I tried to do a code that once the keys "Up" and "Down" are pressed when the "Ctrl" is pressed it would deaccelerate, but, for some reason I still don't know, it haven't work.
Right now I'm looking on this drifting code to see if I can reduce the drift time, that would considerably helps me to find a realistic movement.
It's like this: I had a acceleration functionable code, working as the physic's logic. My problem was that my sprite don't rotate, it only changes the sprite's frame when a key Up or Down is pressed. I deal the rotation considerating that instance's frame as the angle the car. The deal with it was that when the player presses the key "Up" or "Down", the method that changes the sprite is active as long as the key is pressed, so the top-speed for that position of the frame doesn't change and the car will continue to speed like it haven't change the sprite, like a "drift". I'm okay with the car drifting, since it do it too in the original game, but my car drifts for as long as the key is pressed, resulting in cases when it is facing right and still moving left.
I tried to do a code that once the keys "Up" and "Down" are pressed when the "Ctrl" is pressed it would deaccelerate, but, for some reason I still don't know, it haven't work.
Right now I'm looking on this drifting code to see if I can reduce the drift time, that would considerably helps me to find a realistic movement.