Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 13:53
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (bigsmack), 5,135 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 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