ios原生游戏开发
hull.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:hull.size];
2. newSpaceship hull.physicsBody.dynamic = NO;
。
3. createSceneContents SKAction * makeRocks = [SKAction sequence:@ [
[SKAction performSelector:@selector(addRock) onTarget:self]
[SKAction waitForDuration:0.10 withRange:0.15]
]];
[self runAction:[SKAction repeatActionForever:makeRocks];
”
4. addRock static inline CGFloat skRandf() {
return rand()/(CGFloat)RAND_MAX;
}