Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge bodies from one space to another #98

Open
T1mL3arn opened this issue Sep 23, 2015 · 0 comments
Open

Merge bodies from one space to another #98

T1mL3arn opened this issue Sep 23, 2015 · 0 comments

Comments

@T1mL3arn
Copy link

var space1 = new Space();
var space2 = new Space();
var bodies = new BodyList();
bodies.push(new Body());
bodies.push(new Body());
bodies.push(new Body());

space1.bodies.merge(bodies);

// Try to remove bodies from one space and add to another
space2.bodies.merge(space1.bodies/*.copy(false)*/);
trace('space1 bodies: ${space1.bodies.length} ; space2 bodies: ${space2.bodies.length}');

// space1 bodies: 1 ; space2 bodies: 2 without copy();
// space1 bodies: 0 ; space2 bodies: 3 with copy(); - correct out

Also there is no special output with -D NAPE_ASSERT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant