lesson 10 help
Ok I have inserted the (float)cos(heading*piover180) * 0.05f; into my program. But still when i try to move on the zaxis it just spins in a circle, Do I need to define float heading somewhere? Because all i can find in the source code is its initialization.
Ok I finnaly got it to work, now another problem has come up though. It moves forward and backward fine when i havent rotated it on the y axis any. But when i rotate left or right, it doesnt move forward and backward, it moves to the side. How do i make it move forward or backward no matter what direction i am looking at on the yaxis? Thanx
you have to keep track of the angle you are facing and use sin and cos to move you on both the x and z axes.
-------------------------------------------------------BZZZZTT - CRASH - BANG"What was that?!""Captain, it appears that we have encountered a strange sub-space anomaly. I'm getting a high reading of tracheons beams. The anomaly seems to be some kind of rift in the space-time continuum. -- Never mind, Bones was just using the microwave again."
What you need to do is make a
int Angle; // Or somthing like that
and then use
x = speed * float(sin(Angle)) or something like that
I am crap with maths so its probly wrong, actuly im sure it is
i lost my code for that and have forgotten how to do it
----- ShCiPwA -----
int Angle; // Or somthing like that
and then use
x = speed * float(sin(Angle)) or something like that
I am crap with maths so its probly wrong, actuly im sure it is
i lost my code for that and have forgotten how to do it
----- ShCiPwA -----
----- ShCiPwA -----
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement