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, AndrewAMD, NewbieZorro), 16,055 guests, and 7 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
How to limit position #428778
09/03/13 04:31
09/03/13 04:31
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
Hello,
Please help me!
I need to limit the pXent_move, I want keep the physic entity inside the "position.y" limits Ex: lateral movement entity.y = -33; & entity.y = 33;
below the code:

action jogador1_azul()
{

// my.tilt = 43;
//my.skill2 = my.tilt;

ent_setskin(me,jogadorazul,1);
pXent_settype(my,PH_RIGID,PH_CONVEX);
pXent_setmass(my,1);
pXent_setfriction(my,5);
pXent_setelasticity(my,10);
pXent_setdamping(my,3,70);
pXent_setbodyflag (my, NX_BF_DISABLE_GRAVITY,1);
pXent_setbodyflag (my, NX_BF_KINEMATIC,1);
while(1)
{
pXent_move(my,vector(0, my.skill1,0),NULL);

pXent_rotate(my,vector(0,my.skill2,0),NULL);
wait(1);
}
}

Re: How to limit position [Re: fabiomartins] #428782
09/03/13 06:23
09/03/13 06:23
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Not sure how you determined the position constraints that you want, but usually to limit a variable you would use clamp.


Moderated by  HeelX, Spirit 

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