newlinedotco / flappyswift Goto Github PK
View Code? Open in Web Editor NEWswift implementation of flappy bird. More at fullstackedu.com
Home Page: https://www.fullstackedu.com
License: MIT License
swift implementation of flappy bird. More at fullstackedu.com
Home Page: https://www.fullstackedu.com
License: MIT License
OS X Yosemite DP6, Xcode6-Beta6
All of the copyright dates are set way back in 2014. Should we change them? Do we have to?
Hi,
I have downloaded the code and try to compile on XCode 6.4 and gets compilation error.
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 <---
}
}
/FlappySwift-master/FlappyBird/GameScene.swift:206:19: Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'
if you will jump 3-4 times a second, you can over jump the pipes
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.
/Users/macmini/Documents/FlappySwift-master/FlappyBird/GameViewController.swift:17:32: 'dataWithContentsOfFile(_:options:error:)' is unavailable: use object construction 'NSData(contentsOfFile:options:error:)'
Can we add auto lay out so that when we use different simulator like iPad, user can still play the game?
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)
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?
The game directly loads in and there is no page to allow the user to choose when to start playing
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.
Hi, I noticed in the original flappy bird, there would be a game over screen and a score board. How could that be implemented here?
override func supportedInterfaceOrientations() -> Int {
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue)
} else {
return Int(UIInterfaceOrientationMask.All.rawValue)
}
}
FlappySwift/FlappyBird/GameScene.swift:147:46: 'CGFloat' is not convertible to 'UInt8'
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]
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.
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.
Hi.
I don't know much about the Copyright thing, so please help me out here!
Is this OK if I make some changes in the game & publish it to the AppStore (for free)?
What should I do about Copyright?
giving error in Gamescene.swift
in new Xcode6 beta 4
'CGFloat' is not convertible to 'UInt8'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.