ios - SpriteNodes are disappearing randomly upon collision -


i'm creating ios iphone game similar tetris blocks fall sky , stack on each other. however, spritenodes blocks randomly disappear when block comes on top of one.

this block placement, call 10 iterations place random blocks fall:

-(void)setupblocksfort:(float)time {      block *block = (block *)[skspritenode spritenodewithimagenamed:@"block1"];     block.physicsbody = [skphysicsbody bodywithtexture:block.texture size:block.size];     block.physicsbody.dynamic = yes;     block.physicsbody.allowsrotation = no;     block.physicsbody.usesprecisecollisiondetection = yes;     block.physicsbody.restitution = 0;     block.physicsbody.friction = 1.0;     block.physicsbody.categorybitmask = blockmask;     block.physicsbody.collisionbitmask = charactermask | groundmask | blockmask;     block.physicsbody.contacttestbitmask = blockmask | charactermask;      double randomsize = rand_range_double(0.10, 0.5);     block.xscale = randomsize;     block.yscale = randomsize;      block.position = cgpointmake(rand_range_int(0, self.frame.size.width, self.frame.size.height);      skaction *wait = [skaction waitforduration:1.5 * time];     skaction *spawn = [skaction runblock:^{         [self.myworld addchild: block];      }];      skaction *spawnsequence = [skaction sequence:@[wait, spawn]];      [self runaction:spawnsequence]; } 

nowhere in code call remove(node).

i'm developing using spritekit , setup having sknode contains of blocks camera stays focused on character's position in didsimulatephysics() method.

has run issue sprites randomly disappearing?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -