Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, OptimusPrime, AndrewAMD), 14,882 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A little help please? #158550
10/03/07 19:19
10/03/07 19:19
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline OP
Newbie
Techd  Offline OP
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
I have a car entity that I'm not using template with and I would like it to rotate when moving Forward and Reverse, and not rotate when still, the wheels turn by aturndist_pan. When I first start the level the wheels we go left and right, while car body is still(good thing) but when moving backwards wheels move but car wont rotate(bad thing) ex...
this is the code I have so far

var test_1[3] = 280,-70,0;
var test_2[3] = 280,70,0;

while(1)
{
vec_set(temp.x,test_1.x);
vec_rotate(temp.x,my.pan);//sets the rotate
vec_add(temp.x,my.x);

my.aturndist_pan/= 1.03;
my.aturndist_pan=0;
if(key_q){my.aturndist_pan = 0.25;}//sets the key and direction
//turn up for sharp turns
if(key_e){my.aturndist_pan = -0.25;}//sets the key and direction
my.turndist_pan/= 1.03;
my.turndist_pan = clamp(my.turndist_pan,-2.5,2.5);
if(key_w){my.speed_x += (40-my.speed_x)/80;}
if(key_s){my.speed_x -= (40-my.speed_x)/80;}
if(key_q && my.speed_x > 1 || key_e && my.speed_x > 1 )

{
my.no_rotate = off;

if(key_q && my.speed_x == 0|| key_e && my.speed_x == 0 )

{

my.no_rotate = on;
}
}


wait(1);
//my.no_rotate = on;
}
}
}

Re: A little help please? [Re: Techd] #158551
10/03/07 19:31
10/03/07 19:31
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
dont forget the code tags i do it to but oke i am flits

i think its this
because the code doesnt run under 2 and never reachge 0 so my.no_rotate = off; isnt triggerd

if(key_q && my.speed_x > 1 || key_e && my.speed_x > 1 )

{
my.no_rotate = off;

if(key_q && my.speed_x == 0|| key_e && my.speed_x == 0 )

i will look futere becuase it falt still there but it will help you maby


"empty"
Re: A little help please? [Re: flits] #158552
10/03/07 20:06
10/03/07 20:06
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline OP
Newbie
Techd  Offline OP
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
Hi, flits..

This is what did it,
if(key_w)

{
my.no_rotate = off;

if(key_q && my.speed_x == 0|| key_e && my.speed_x == 0 )

{

my.no_rotate = on;
}
}



if(key_s)
{
my.no_rotate = off;
}
wait(1);
my.no_rotate = on;
}
}
}

Now the wheels turn when the car is still, and the reverse turn and forward turn works! thanks for your help.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1