Game Development Community

2 Questions, Sprint and Air Control.

by Stephen · in Torque Game Engine · 04/10/2006 (4:07 pm) · 5 replies

I have added both resources to my project and noticed 2 things. My first question has to do with the sprint resource, how can you fix it where you can only sprint forward, not backwards and not sideways. My second question is with the Air Control, one thing about this resource is that if you jump up while moving forward, you make like a long jump and I would like to fix that. How can you fix it where when you jump while moving forward you disables you from moving forward. Like the stand jump.

Thanks

#1
04/13/2006 (8:56 pm)
Does anyone have any ideas on how to fix these problems?
#2
04/13/2006 (9:34 pm)
You could make the air control not add to your velocity when it's at it's max, in fact I think if you read the messages afterwards, it says how to fix that. I don't know what "sprint" resource you are using, but you would have to have it only take effect on your y+ movement attempts.
#3
04/13/2006 (9:52 pm)
Hey thanks, it's been awhile since I used the resource and forgot to read though the comments. Next time, I'll pay more attention to them.

Here's the link to the Sprint Resource.
#4
04/13/2006 (11:40 pm)
Okies, so yeah, to have it only do it when going forward, change the
if(move->sprint)

//to 

if(move->sprint && move->y > 0)

And add "&& move->x == 0" if you wanted it to only be when running directly foward.
#5
04/14/2006 (7:33 am)
Awesome, works like charm! Thankyou very much for the help!

And if anyone else is wondering how to fix the move bug in the Air Control Resource, just change

Player.cc
if (!inLiquid && mDataBlock->airControl > 0.0f) {

to

if (!inLiquid && mDataBlock->airControl > 0.0f && moveVec.x != 0 && moveVec.y != 0) {