Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 692 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 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 | chip programmers | 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