In a previous recipe, we handled user input to allow the user to drag an object. In this example, we see a bowl filled with pieces of fruit that can be dragged across the screen. A piece of fruit does not collide with another piece of fruit.
enum { //Collision bits for filtering CB_GROUND = 1<<0, CB_FRUIT = 1<<2, CB_BOWL = 1<<4 }; @implementation Ch4_DraggingAndFiltering -(CCLayer*) runRecipe { [super runRecipe]; [message setString:@"Pick up the fruit."]; //Create level boundaries [self addLevelBoundaries]; //Add fruit bowl [self addFruitBasket]; //Initialization of any variables fruitGrabbed = NO; return self; } /* Add basket and fruit objects */ -(void) addFruitBasket { /* Add the basket */ /* CODE OMITTED */ //Add physical parts b2BodyDef bowlBodyDef; bowlBodyDef...