Flappy Bird in Swift
71–80 of 126 posts
Re: Flappy Bird in Swift
#72This 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.
The language isn't tailored to it, but there are things it makes easy that are. If that makes any sense.
Re: Flappy Bird in Swift
#73Author here - I didn't expect to see this here this morning. I'd intended to write a longer post :) In any case, here's a few things I learned about swift yesterday building this. Please note that I have about 4 hours swift experience, so feel free to correct anything I say that's wrong. 1. To make properties on a class you simply declare the variable on the class e.g.: class GameScene: SKScene { var bird = SKSpriteN…
I think just the fact that you were able to build a game with just 4 hours of learning a new language speaks volumes about Swift's barrier to entry. Well done!
Re: Flappy Bird in Swift
#74pretty neat! I am not an iOS developer but if i understand correctly this uses the new Sprite Kit stuff included in iOS8 for 2d rendering right ? Is this a threat to existing 2d/game engines ? Not sure where SpriteKit integrates into the existing stack for making a game.
Looks like a good way for Apple to lock the developers to their platform. In past glory days people used to make games for iOS first and consider porting to Android much later. These days developers think cross-platform from the start, esp. since it's much easier to test waters and iterate on Android. I guess that SpriteKit is an attempt to stop this trend. Smart move by Apple IMHO, but perhaps a little bit too late.
The departure from this ideal, I've discovered, is that there is a "Practical Crowd" who will swoop through when questions of practicality, such as cross-platform compatibility come up. Their opinions will be nearly absolute and they will be all but intolerant of the "weak" who claim that merely targeting Windows, Linux and OSX is "enough." They will justify with numerous cherry-picked examples from history, starkly, if not carefully, considered arguments toward the future, and with evidence of grit on their fingers from the present, in which the particular ideal is espoused. At that time, they will down vote anyone deviant enough to cheer for Swift.
Yet, currently my friend, the Apple Crowd has the floor. Any practical concerns are scheduled after the celebration. Think of this when you read the next cross-platform thread and see the Apple fans trying to get a point in edgewise amongst The Practical. There is very little global reality, mainly local basins of morality.
Re: Flappy Bird in Swift
#75As 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.
I get where you're coming from - but in my experience, the barrier is totally psychological. Objective C isn't that unusual a language - the syntax is a bit foreign, but nothing that takes more than a couple of days to wrap your head around. You'll spend far more time getting to grips with Cocoa/Cocoa Touch.
Re: Flappy Bird in Swift
#76This being the only code sample of swift I've seen, my overriding takeaway is that for the basic stuff it's remarkably similar to Objective-C with a lick of paint. If people really take to swift, it'll be interesting to see if that's because it creates a shift in programming style, or because people really are just afraid of small syntactical differences.
Re: Flappy Bird in Swift
#77As 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.
I get where you're coming from - but in my experience, the barrier is totally psychological. Objective C isn't that unusual a language - the syntax is a bit foreign, but nothing that takes more than a couple of days to wrap your head around. You'll spend far more time getting to grips with Cocoa/Cocoa Touch.
Of course it is. It's certainly not a physical barrier. But psychological or not, other languages don't have a similar barrier.
Re: Flappy Bird in Swift
#78Earlier quoted context omitted.
I think just the fact that you were able to build a game with just 4 hours of learning a new language speaks volumes about Swift's barrier to entry. Well done!
But the code was just a port/convert, seems relatively non-trivial to do that in 4 hours.
Re: Flappy Bird in Swift
#79Earlier quoted context omitted.
I get where you're coming from - but in my experience, the barrier is totally psychological. Objective C isn't that unusual a language - the syntax is a bit foreign, but nothing that takes more than a couple of days to wrap your head around. You'll spend far more time getting to grips with Cocoa/Cocoa Touch.
the barrier is totally psychological Of course it is. It's certainly not a physical barrier. But psychological or not, other languages don't have a similar barrier.
It's far more difficult to get to grips with how the APIs work.
Re: Flappy Bird in Swift
#80Earlier quoted context omitted.
I get where you're coming from - but in my experience, the barrier is totally psychological. Objective C isn't that unusual a language - the syntax is a bit foreign, but nothing that takes more than a couple of days to wrap your head around. You'll spend far more time getting to grips with Cocoa/Cocoa Touch.
That's my problem. I can't even find the entry point for this application. Looking at AppDelegate.swift I see an unused var (window) and that's it.
In this sense, the code is even less clear than the Objective C implementation.