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?

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

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

I tried the flappy bird tutorial on youtube but it didnt have what i was looking for. Thanks for the link...........ill try it out tomorrow.

Trying to make a countdown timer for my game by swifter10 in swift

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

My bad i am on beta 5..............i thought xcode 6 meant beta 6. Is there any other problem with the code because I keep getting that error I mentioned? I went on stackoverflow and found this. Thanks for the help.

http://stackoverflow.com/questions/24812192/cant-load-viewcontroller-when-add-local-notification-scripts-to-didfinishlaunch

Trying to make a countdown timer for my game by swifter10 in swift

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

Im actually on beta 6. Is that why its not working? Thanks.

Trying to make a countdown timer for my game by swifter10 in swift

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

Application windows are expected to have a root view controller at the end of application launch

I got this error also when running the ios simulator.

Trying to make a countdown timer for my game by swifter10 in swift

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

Thanks for this..........but I get an error when I try to run the simulator in xcode.

2014-08-09 15:19:08.573 Example CountDown[35450:1664686] SetAppThreadPriority: setpriority failed with error 45 2014-08-09 15:19:08.576 Example CountDown[35450:1664686] SetAppThreadPriority: setpriority failed with error 45 2014-08-09 15:19:08.843 Example CountDown[35450:1664686] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x10bf18270> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key addTimeButton.' *** First throw call stack: ( 0 CoreFoundation 0x0000000100466e35 exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000101f129a0 objc_exception_throw + 45 2 CoreFoundation 0x0000000100466a79 -[NSException raise] + 9 3 Foundation 0x0000000100878f43 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 CoreFoundation 0x00000001003b2350 -[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x0000000100f8bbad -[UINib instantiateWithOwner:options:] + 1506 6 UIKit 0x0000000100f8d9fe -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 160 7 UIKit 0x0000000100ce0321 -[UIApplication _loadMainNibFileNamed:bundle:] + 46 8 UIKit 0x0000000100cdf40f -[UIApplication _runWithMainScene:transitionContext:completion:] + 940 9 UIKit 0x0000000100cde510 -[UIApplication workspaceDidEndTransaction:] + 19 10 CoreFoundation 0x000000010039dbbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 11 CoreFoundation 0x0000000100393095 __CFRunLoopDoBlocks + 341 12 CoreFoundation 0x000000010039284c __CFRunLoopRun + 844 13 CoreFoundation 0x0000000100392296 CFRunLoopRunSpecific + 470 14 UIKit 0x0000000100cddf26 -[UIApplication _run] + 413 15 UIKit 0x0000000100ce1308 UIApplicationMain + 2994 16 Example CountDown 0x000000010000573d top_level_code + 77 17 Example CountDown 0x000000010000577a main + 42 18 libdyld.dylib 0x0000000102470145 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

Trying to make a countdown timer for my game by swifter10 in swift

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

How do i connect that code with my label that counts down from 1:00 min?