views:

31

answers:

0

im making a game kind of like tetris but i cannot figure out how to get the blocks to stack on top of each other. this is the code im using to try and get the to have collision.

if (CGRectIntersectsRect(shapeView.frame,shape2View.frame)) {

}

but it doesnt work.

this is the shapeView and shape2View code

UIImageView *shapeView = [[UIImageView alloc] initWithImage:shape];
UIImageView *shape2View = [[UIImageView alloc] initWithImage:shape2];

if anyone could please help with this that would be great. If anyone knows of a open source game i could use or a tutorial then please post it or if you know how to do this.

Thanks