Live data from Hacker News

Flappy Bird in Swift

github.com

51–60 of 126 posts

Re: Flappy Bird in Swift

#51

This may be a stupid question but is the language in some way tailored to game programming? Apple's examples at WWDC were game companies, their coding demo was a game, and this is the first project I've seen written in it - and it's a game.

Games make easy examples because you can do a simple render loop and input. Most people understand the concept of sprites and basic animation. Apple's UI frameworks are all MVC based, which means multiple classes and apple specific UI terminology.

Additionally, they're a quick route between code and something visual. If the demo yesterday had been "look how easy I can make a tableview", no one would have cared much, but the circus scene had motion, lights, and barely any code. People love spectacle.

That reads a lot more sarcastic than it should have, but it's unfortunately true. Swift was announced in front of a room of people who needed to be convinced to start migrating from something they all know (ObjC) in favor of something new, so you have to win them over quick.

Re: Flappy Bird in Swift

#52

Earlier quoted context omitted.

Swift is definitely more approachable than Objective-C for new developers. I would imagine that is very on the reasons for creating it.

For new developers, or for developers coming from other languages? I think a lot of the trouble people have with starting to develop apps for Apple platforms actually comes from trying to figure out the APIs and style, while at the same time battling against unfamiliar syntax. From the little I've seen, Swift doesn't change the first part of that very much.

I think both. I have a young cousin who is starting to show interest in programming, and when I think of showing her Objective-C, I grimace inside because it has taken me so long to become comfortable with it, and I'm coming from other languages and years of experience. But I think I can walk through Swift with her, and we can learn it at the same time - me bridging the gaps because I come from another language, and her learning how to program for the first time.

Re: Flappy Bird in Swift

#53
post #48

Swift looks fine, the only thing I don't like its that is for Apple only products... that kinda defeats the purpose of having a programming language.

Good luck compiling Objective-C on Windows :)

Pretty sure you can compile Objective-C on Windows, since gcc supports it, and OpenStep worked on Windows.

It's Apple's libraries you don't get on Windows.

Re: Flappy Bird in Swift

#54
As a C# developer, I can read and understand the code without any issues. That's a good thing for Apple. I'm sure Objective-C is great but it's too foreign for me and didn't want to toy with it for fun, not worth the effort. But I can write an app or two with this one.

Re: Flappy Bird in Swift

#55
Always had a problem with Objective C, could never read it (Android Dev) but this right here is pretty impressive. I like the mixture of language features. But my only question, are you still locked to using an mac to develop for iOS. I guess since the language is closed source it depends on some osx libs at compile time.

Re: Flappy Bird in Swift

#57
post #55

Always had a problem with Objective C, could never read it (Android Dev) but this right here is pretty impressive. I like the mixture of language features. But my only question, are you still locked to using an mac to develop for iOS. I guess since the language is closed source it depends on some osx libs at compile time.

Yes, you still need a Mac to develop for iOS. Come to the dark side! :)

Re: Flappy Bird in Swift

#59
post #3

Earlier quoted context omitted.

SpriteKit was released last year with iOS 7. It's a pretty much self-contained 2D game engine like Cocos2D, including stuff like physics simulation. iOS 8 is going to ship with SceneKit, which is similar but for simple 3D games.

How extensive is the physics engine implementation?

In iOS7 it is Box2d, but not all of it was implemented. There is likely a lot more now in iOS8. There is also a 3d version which I assume uses Box3d.
Post reply on HN