Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / A little help with the dbNewX/ZValue function

Author
Message
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 15th Aug 2011 01:04
Hi all,


So guys please help me with this function. My space ship is moving in the direction its facing(inc by mouse x). And the problem is that the object is not moving in the right direction. That is its moving a little tilted. As far as i know that when the ay comes in 20 to 80 , the newxvalue and z value is not calculated correctly.

Note that some of the values are initialized in the object class. So ay is not changed at all except in this function.
The code function:


Thanks in advance.

Your signature has been erased by a mod
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 15th Aug 2011 13:42
Found the problem. I knew something was wrong with my logic.
The codes which keeps the vx and vz from going above 2 or below -2 was making them go awkward.

So the correct way of doing this was to decrease the speed. But i changed the the limiting code to division code. i.e. vx=vx/(5-topspeed);

Thanks guys.

Like someone here said. "Take a step back, your problem is easier then it seems , breath....."

Your signature has been erased by a mod

Login to post a reply

Server time is: 2024-11-19 08:41:37
Your offset time is: 2024-11-19 08:41:37