2048-spritebuilder-swift's People
2048-spritebuilder-swift's Issues
Part 0 should be split in two
It should be split into SpriteBuilder and XCode. It's almost exactly half.
p5 - keep track of high scores
func didLoadFromCCB() {
NSUserDefaults.standardUserDefaults().addObserver(self, forKeyPath: "highscore", options: .allZeros, context: nil)
updateHighScore()
}
NSKeyValueObserving options has no value ".allZeros" should use NSKeyValueObservingOptions.Old
func didLoadFromCCB() {
NSUserDefaults.standardUserDefaults().addObserver(self, forKeyPath: "highscore", options: NSKeyValueObservingOptions.Old, context: nil)
updateHighScore()
}
Part 1 should be split in two
It should be split into movement and merging - perhaps titled Movement and Game Logic (or some iteration on game logic) respectively.
Movement is a large conceptual unit which should be tackled by itself. Students will first ask about movement not tied into the game - they need to wrap their head around moving tiles around a grid.
Merging then assumes they have a firm grasp of the movement and they can move onto actual game logic. Below merging exists a lot of game logic, which is why it deserves a more general header.
On website, tutorial is out of order
Redundant headers
On the website, the header "X. Build your own 2048 with SpriteBuilder and Swift - Part X!" shows up at the beginning of every section.
Part 2 should be split in two
It should be split into Scoring and Polish.
The scoring includes keeping track of score and local high score storage, which is a conceptual unit.
The latter part involves the final visual touches - a separate conceptual unit.
winTile referenced in P4 but not added until P5
Problems in Setting up classes in Xcode
1.I just copied the code and Xcode showed some issues about "fun setupBackground":
" backgroundTile is immutable"
then i added "as! CCNode" to "let backgroundTile = ..." and fixed it.
2.The function didLoadFromCCB need to be added to Grid.Class instead of Grid.swift or there would be an issue "use of unresolved identifier "setupBackground""
func didLoadFromCCB() {
setupBackground()
}
3.Last, I built the project successful, but it stopped running soon and the output:
2016-01-21 09:34:08.702 My2048Game[885:28936] cocos2d: animation started with frame interval: 60.00
2016-01-21 09:34:08.706 My2048Game[885:28936] cocos2d: surface size: 640x1136
2016-01-21 09:34:08.713 My2048Game[885:28936] CCBReader: Couldn't find member variable: backgroundNode
2016-01-21 09:34:08.713 My2048Game[885:28936] CCBReader: Couldn't find member variable: valueLabel
Could not cast value of type 'CCNode' (0x108cfcf98) to 'My2048Game.Tile' (0x108cfcb30).
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.