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
1 registered members (TipmyPip), 18,619 guests, and 5 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 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 | 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