O'Reilly logo

Cocos2d Cross-Platform Game Development Cookbook - Second Edition by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the Swift syntax

Playground is a very versatile tool. Whenever you create a new file, you can start working on it immediately without any further setup. It has an inbuilt "Results" panel on the right-hand side that will compile your code in real time every time you make any changes to the file. There is also an "assistant editor" that provides a graphical representation of the changes we make in the code.

Getting started

Create a new Playground file, name it whatever you want, and then open it up. Or, if you already created a file in the first chapter, you will already have a file in the Playgrounds folder, which you can open up.

How to do it…

Let's take a look at the Swift syntax in practice.

Variables

If you have some experience coding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required