Please help me with this weir problem. I'm working on a iPad 5.1 project. The interface of my project is: a pallet (UIView) at the top of screen and a GameArea (ScrollView) below pallet. Inside GameArea, there are one ground (UIImageView) and one BackGround (UIImageView). Inside pallet, there are a few small items which you can drag it from pallet to GameArea. What I want to do is simulate a physics world in the GameArea only. Means, any item in the GameArea can have a gravity and it's bounced up when it collides with ground.
I have done everything step by step in the simple objective-chipmunk tutorial (http://chipmunk-physics.net/tutorials/S ... eChipmunk/). I tried to do something like this:
Code: Select all
space = [[ChipmunkSpace alloc] init];
CGRect spaceBounds = CGRectMake(0, 60, 1024, 300);
[space addBounds:spaceBounds thickness:10.0f elasticity:1.0f friction:1.0f layers:CP_ALL_LAYERS group:CP_NO_GROUP collisionType:borderType];
space.gravity = cpvmult(cpv(0.0, 1.0), 100.0f);