Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cocos2d Game Development Essentials

You're reading from   Cocos2d Game Development Essentials For new users - a quickstart guide to bringing your mobile game ideas to life with Cocos2D

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784390327
Length 136 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ben Trengrove Ben Trengrove
Author Profile Icon Ben Trengrove
Ben Trengrove
Arrow right icon
View More author details
Toc

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:

Creating Flappy Square
  1. This screen will be the menu scene of the app. Let's add a button so that players can actually start the game.
  2. Drag a button from the left-hand side of SpriteBuilder onto your scene.
  3. Position the button at the center of the scene and change its text to Start Game.
  4. Now to add the code that will run when this button is pressed, you need to add a code connection.
  5. In the options pane, open the second tab on the right-hand side of the screen. In the field marked selector, type start.
    Creating Flappy Square
  6. This is the method that Cocos2d will attempt to call when you tap on the button. Currently...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image