Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How can I make two same entity not hit each other? #276916
07/07/09 04:12
07/07/09 04:12
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
How can I make two same entity not hit each other?
I have my code below but they two created new balls still collide to each other. some advice please...


function bounce_off()

{
if (you) // collided with another entity?
{
if( (you._ball!=10) && (me._ball!=10))
{

set(my,ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_DETECT);
effect(particle_ball,maxv(1,40*time_step),my.x,vector(0,0,5));
vec_to_angle(my.pan, bounce);
my.pan += 5 - random(10);
my.tilt = 0;
my.roll = 0;
my.z = 0;

}else if( (me._ball==10) && (you._ball==10))
{

set(you,IGNORE_YOU);
set(me,IGNORE_ME);


}
}

}

Re: How can I make two same entity not hit each other? [Re: uone] #276952
07/07/09 08:42
07/07/09 08:42
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
set their flag2 and then IGNORE_FLAG2 in the c_move.

You can also create collision groups: instead of this:

set(you,IGNORE_YOU);
set(me,IGNORE_ME);

put:

return(0);

and then in the c_move use ACTIVATE_PUSH as a mode.


~"I never let school interfere with my education"~
-Mark Twain
Re: How can I make two same entity not hit each other? [Re: Germanunkol] #276969
07/07/09 09:48
07/07/09 09:48
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
thanks man.... your the best!
what a quick solution it works now.

Re: How can I make two same entity not hit each other? [Re: uone] #277420
07/09/09 08:47
07/09/09 08:47
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
No problem.
If you ever figure out why there's an IGNORE_FLAG2, but no IGNORE_FLAG3, tell me :P


~"I never let school interfere with my education"~
-Mark Twain
Re: How can I make two same entity not hit each other? [Re: Germanunkol] #277423
07/09/09 08:49
07/09/09 08:49
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
xD


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: How can I make two same entity not hit each other? [Re: VeT] #277438
07/09/09 09:31
07/09/09 09:31
Joined: Jun 2009
Posts: 17
Cebu Philippines
U
uone Offline OP
Newbie
uone  Offline OP
Newbie
U

Joined: Jun 2009
Posts: 17
Cebu Philippines
no, can you explain to me?

Re: How can I make two same entity not hit each other? [Re: uone] #277439
07/09/09 09:35
07/09/09 09:35
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Sorry, I have no idea why that is. But using ACTIVATE_PUSH works for defining large numbers of collision groups, so it's fine. Just IGNORE_FLAG2 would be much faster (in code, and I think in calculation at runtime, too.)
I was just wondering why they never added it...


~"I never let school interfere with my education"~
-Mark Twain

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

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