GithubHelp home page GithubHelp logo

newlinedotco / flappyswift Goto Github PK

View Code? Open in Web Editor NEW
9.7K 9.7K 2.7K 232 KB

swift implementation of flappy bird. More at fullstackedu.com

Home Page: https://www.fullstackedu.com

License: MIT License

Swift 100.00%

flappyswift's People

Contributors

aliast avatar auser avatar christopherstott avatar dmitriykirakosyan avatar jarinosuke avatar jashmenn avatar jollyjinx avatar krankin avatar maddthesane avatar mihoubnaceri avatar omor1 avatar pawurb avatar ryannair05 avatar sballan avatar softdevstory avatar wacumov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flappyswift's Issues

Error in Swift 3.0

screen shot 2016-09-05 at 9 59 20 pm
screen shot 2016-09-05 at 9 59 33 pm
Getting these two errors in Swift 3.0 with Xcode beta 8.Please Fix this.

Copyright Dates

All of the copyright dates are set way back in 2014. Should we change them? Do we have to?

Code Compile Error

Hi,

I have downloaded the code and try to compile on XCode 6.4 and gets compilation error.

Use of unresolved identifier 'clamp'

Hello, would anyone be able to help me identify why i'm getting this error?? "use of unresolved error 'clamp'. let me know if you need to see more code.

Thank you!!

override func touchesBegan(touches: Set, withEvent event: UIEvent) {
/* Called when a touch begins */

    bird.physicsBody?.velocity = CGVectorMake(0, 0)
    bird.physicsBody?.applyImpulse(CGVectorMake(0, 8))

    func clamp (min: CGFloat, max: CGFloat, value: CGFloat) -> CGFloat {
        if( value > max ) {
            return max;
        } else if( value < min ) {
            return min;
        } else {
            return value;
        }
    }}


  override func update(currentTime: CFTimeInterval) {
        /* Called before each frame is rendered */

    bird.zRotation = clamp.self( -1, max: 0.5, value: bird.physicsBody!.velocity.dy * ( bird.physicsBody!.velocity.dy < 0 ? 0.003 : 0.001 ) ) // this is where the issue is <---
    }
    }

error in GameScene.swift

/FlappySwift-master/FlappyBird/GameScene.swift:206:19: Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'

[Critical] 22 build issues in Xcode 6.0.1

When I try to run FlappySwift in Xcode 6 (official release), I get 22 errors of the same type:
Swift Compiler Error: <something> does not have a member named <something else>

All errors are in the GameScene.swift file. This is a critical error which stops the program from functioning at all.

dataWithContentsOfFile error

/Users/macmini/Documents/FlappySwift-master/FlappyBird/GameViewController.swift:17:32: 'dataWithContentsOfFile(_:options:error:)' is unavailable: use object construction 'NSData(contentsOfFile:options:error:)'

Black Bars on 4.7" and 5.5" screens

There are black bars on the top and bottom of the screen on iPhone 6 and 6 plus. This is due to the lack of launch images for theses screen sizes.
Adding a launch image or using the new Launch Screen storyboards should fix the issue.
bildschirmfoto 2015-10-03 um 23 23 21

Bug on Device

Run on my iphone5 (iOS 7.1.1). Broke when the screen was still dark. Guess is the problem for SpriteKit since even initial game app written in Swift with SpriteKit can't work on device, while change to OC it works fine.

flappybirdbug

Bird can fly off the screen

If you keep touching the screen, the bird is able to fly off the screen and avoid all obstacles. This can be easily fixed by adding

if bird.position.y > self.frame.size.height {
bird.position.y = self.frame.size.height
}

inside override func update(currentTime: CFTimeInterval)

Xcode 6 crashed when open .sks file

Everytime when I open .sks file Xcode crashes or even worse system becames freezed (OS X 10.9)..

This is very annoying cause it prevents me from experimenting with Swift and SpriteKit, anybody experienced this issue too?

Swift 3 @objc inference in Swift 4 mode is deprecated.

Xcode 9 gives the error:
Showing Recent Issues
The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "FlappyBird" target.

Should be a pretty easy fix, I'll get right on it and should have it done very shortly, at the very most by tonight (if I can't do it before the day starts) that is unless of course somebody else does it.

In the new version toRaw() is replaced by rawValue

override func supportedInterfaceOrientations() -> Int {
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue)
} else {
return Int(UIInterfaceOrientationMask.All.rawValue)
}
}

GameViewController.swift and 3 errors

I have download the project, then use xcode 6.3.1 to open FlappyBird.xcodeproj

however, i have got the follow three errors, andy idea how to fix these issues?

FlappySwift-master/FlappyBird/GameScene.swift:206:19: Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'

FlappySwift-master/FlappyBird/GameViewController.swift:15:58: 'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?

FlappySwift-master/FlappyBird/GameViewController.swift:34:36: 'UIView!' is not convertible to 'SKView'; did you mean to use 'as!' to force downcast?

thanks
email: [email protected]

Authors

If you translate J. K. Rowling's Harry Potter and the Philosopher's Stone to Swahili you will not become the author of the work. Likewise, translating Matthias Gall's Objective-C code to Swift does not make you the author, but a translator. Claiming copyright and authorship is a bit dishonest.

License?

Hello. I am wondering if there is a license for this project? Is one able to use the code as a base for an app that will be released to the app store that will not make money?

Thanks.

xcode6 beta4 error

giving error in Gamescene.swift
in new Xcode6 beta 4
'CGFloat' is not convertible to 'UInt8'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.