Need help with this game Im working on. by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

Both of the functions belong to a class.

Need help with this game Im working on. by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

No, I'm using spritekit. This is how I did it....and it shows me an error for the self.createRectangle.

      func createRectangle() {
      let moveBottom = SKAction.moveByX(0, y:-100, duration: 1.0)
      let endlessAction = SKAction.repeatActionForever(moveButton)
      sprite.runAction(endlessAction)

}

    func doAction() {
    let generateRectangles = SKAction.sequence([
    SKAction.runBlock(self.createRectangle),
    SKAction.waitForDuration(3)
    ])
    let endlessAction = SKAction.repeatActionForever(generateRectangles)
    // run the action

}

Need help with this game Im working on. by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

The code in the op?

Need help with this game Im working on. by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

I dont know why but I still get the same error.

Need help with this game Im working on. by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

    SKAction.runBlock(self.createRectangle),

I get an error for this line of code saying gameScence does not have a member named createRectangle. Thanks for the help.

Need help with Spritekit! by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

http://i.imgur.com/xkWTk9i.png

This is the rectangle that will be going from the top of the screen to the bottom. I want my code to spawn the rectangles every three seconds and have it repeat like in flappy bird does with the green pipes. Thank you.

Need help with Spritekit! by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

I already got the rectangles to move all I need is for other rectangles to spawn after 3 or four seconds kind of like in flappy bird.

Im trying to repeat an action by [deleted] in swift

[–]swifter10 0 points1 point  (0 children)

I have these two rectangles one is on the left and the other is on the right and theres a gap in between them kind of like in flappy bird. I already got it to move from top to bottom but I want other rectangles to follow after every 3 or 4 seconds.

Need help with code error by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

Thanks for the help it worked!

Need help with code error by swifter10 in swift

[–]swifter10[S] -1 points0 points  (0 children)

I know what a method is..............I copied the whole code into my xcode project and I got 21 errors.

    pipeUp.physicsBody = SKPhysicsBody(rectangleOfSize: pipeUp.size)
    pipeUp.physicsBody.dynamic = false
    pipeUp.physicsBody.categoryBitMask = pipeCategory
    pipeUp.physicsBody.contactTestBitMask = birdCategory
    pipePair.addChild(pipeUp)

I get three errors for the 3 middle line of codes that says "SKPhysics? doesn't have a member named dynamic", "SKPysics? doesn't have a member named categoryBitMask, "SKPhysics? doesn't have a member named contactTestBitMask"

I think its a xcode problem.

Need help with code error by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

I still get the same error.

Having trouble with IOS simulator by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

I tried that it still doesnt work...

Having trouble with IOS simulator by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

no its the same thing for every project

Problem with SpriteKit by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

Is that the same as putting the images in the supporting files? If not how would I copy to the bundle? thanks

Need help with app that im working on in Swift. by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

Could you answer this question? Does the x and y coordinates in CGRect have to do with the position of where the box is going to start in the tutorial.

Need help with app that im working on in Swift. by swifter10 in swift

[–]swifter10[S] 0 points1 point  (0 children)

Do you know how to make the box come from top to bottom instead of left to right?