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
c_rotate and joy_force #161011
10/15/07 02:25
10/15/07 02:25
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline OP
Newbie
Techd  Offline OP
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
I've tried a lot of different ways of coding this but I'm stuck.

c_rotate(me,vector((key_q-key_e)*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide);

instead of key_q-key_e I would like joy_force.x < 0-joy_force.x > 0

c_rotate(me,vector((joy_force.x < 0-joy_force.x > 0))*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide); This example is the wrong method


Life is what you make it just like Games!
Re: c_rotate and joy_force [Re: Techd] #161012
10/15/07 07:31
10/15/07 07:31
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Quote:

I've tried a lot of different ways of coding this but I'm stuck.

c_rotate(me,vector((key_q-key_e)*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide);

instead of key_q-key_e I would like joy_force.x < 0-joy_force.x > 0

c_rotate(me,vector((joy_force.x < 0-joy_force.x > 0))*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide); This example is the wrong method




why dont you do:
Code:
 
var joy_Xforce = joy_force.x;
joy_Xforce = clamp(joy_Xforce, 0, 2);
var joy_Yforce = joy_force.y;
joy_Yforce = clamp(joy_Yforce, 0, 2);

c_rotate(me,vector((joy_Xforce-joy_Yforce))*10*time_step,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide);



made from the top of my head, so i didnt test it, might be a bit bugged, but should work.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: c_rotate and joy_force [Re: Helghast] #161013
10/15/07 18:05
10/15/07 18:05
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline OP
Newbie
Techd  Offline OP
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
This is what I have this works for turning the car wheels while the car is still!
my.turndist_pan = clamp(my.turndist_pan,-2.5,2.5);
if(key_q || (joy_force.x < 0)){my.aturndist_pan = 0.25;}//sets the key and direction of turndistance of wheels "left"
//turn up for sharp turns
if(key_e || (joy_force.x > 0)){my.aturndist_pan = -0.25;}//sets the key and direction of turndistance of wheels"right"

This works for rotating and turning the car while accelerating with key_q and key_e(rotate with keyboard) key_cuu || joy_3 accelerate
If(key_cuu || joy_3)
{
my.speed_x += (60-my.speed_x)/80;
vec_rotate(my_speed.x,my.pan);
c_rotate(me,vector((key_q-key_e)*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide); This works coded this way



I need joy force to rotate the same way ex.
c_rotate(me,vector((joy_force.x-joy_force.x)*10*time,my_angle.tilt-my.tilt,my_angle.roll-my.roll),glide);

Thanks for your help! I tested your code it conflicted with what I have.


Life is what you make it just like Games!
Re: c_rotate and joy_force [Re: Helghast] #161014
10/17/07 07:00
10/17/07 07:00
Joined: Oct 2007
Posts: 42
Minnesota, USA
Techd Offline OP
Newbie
Techd  Offline OP
Newbie

Joined: Oct 2007
Posts: 42
Minnesota, USA
I solved it!


Life is what you make it just like Games!

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