[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Updating Screen Boundaries
Page 1 of 1

Updating Screen Boundaries

PostPosted: Thu May 27, 2010 9:14 pm
by ArtDev
Hey Guys,

I'm working on a game for the iPhone that right now is just a background and some screen boundaries the back ground is currently 640x960 which is twice the size of the iphone screen so that the background has to move around depending on where the user is at...I've got this working the background moves just fine, what I can't get is the screen boundaries to move...they are normal screen boundaries found on the many examples in this forum.


floorBody = cpBodyNew(INFINITY, INFINITY);
leftWallBody = cpBodyNew(INFINITY, INFINITY);
rightWallBody = cpBodyNew(INFINITY, INFINITY);
ceilingBody = cpBodyNew(INFINITY, INFINITY);
cpShape* floorShape = cpSegmentShapeNew(floorBody, cpv(-160,0), cpv(480,0), 1);
floorShape->e = 0.6;
floorShape->u = 0.3;
floorShape->collision_type = 0;
cpSpaceAddShape(space, floorShape);

floorShape = cpSegmentShapeNew(leftWallBody, cpv(-160,0), cpv(-160,960), 1);
floorShape->e = 0.6;
floorShape->u = 0.3;
floorShape->collision_type = 0;
cpSpaceAddShape(space, floorShape);

floorShape = cpSegmentShapeNew(ceilingBody, cpv(-160,960), cpv(480,960), 1);
floorShape->e = 0.6;
floorShape->u = 0.3;
floorShape->collision_type = 0;
cpSpaceAddShape(space, floorShape);

floorShape = cpSegmentShapeNew(rightWallBody, cpv(480,0), cpv(480,960), 1);
floorShape->e = 0.6;
floorShape->u = 0.3;
floorShape->collision_type = 0;
cpSpaceAddShape(space, floorShape);
//End Screen Boundaries

I've read the documentation and it says to not update the body per step but I don't know how else to change the position of the boundaries... if anyone could point me in the right direction I would appreciate it.

Thank you in Advance

Re: Updating Screen Boundaries

PostPosted: Thu May 27, 2010 9:55 pm
by slembcke
I'm not sure I understand. You want the screen boundaries to move? Like as if the objects were placed inside a box and you were moving the box around with the objects inside of it? Somehow I'm thinking this isn't really what you want though.

You can move the position of a body every frame if you update its velocity to match (position delta divided by time).

Re: Updating Screen Boundaries

PostPosted: Fri May 28, 2010 11:28 am
by Tam Toucan