Creating Flappy Square
Let's start creating what is sure to be the next big hit on the App Store: Flappy Square. Flappy Square is a Flappy Bird clone that uses squares instead of fancy graphics. Don't worry! you will add some proper assets in the next chapter.
You should currently have a screen that looks like the following screenshot; if you don't move your label so it is in the same position and change its text:
- This screen will be the menu scene of the app. Let's add a button so that players can actually start the game.
- Drag a button from the left-hand side of SpriteBuilder onto your scene.
- Position the button at the center of the scene and change its text to
Start Game
. - Now to add the code that will run when this button is pressed, you need to add a code connection.
- In the options pane, open the second tab on the right-hand side of the screen. In the field marked selector, type
start
. - This is the method that Cocos2d will attempt to call when you tap on the button. Currently...