Game Development Reference
In-Depth Information
Once you've unchecked the Global and Levels folders, their contents should no longer ap-
pear in the Tileless Editor View.
You should now drag and drop the Player onto the Level1.ccb stage to create a Sub File
node referencing the Player.ccb. Try to place the player very far left in the level as the
game will scroll from left to right.
To move the stage, hold down the Cmd key and then left-click and drag.
If you publish, build, and run the game now, the player instance you added to the
Level1.ccb may or may not be visible on the screen, depending on the device and where
exactly you positioned the player instance. If you can't see the player in the GameScene,
move its position in Level1.ccb toward the lower-left corner of the level until you can see
it in the app.
This state of the project is also reflected in the project inside the 02 - Level with Player
Prefab folder.
Summary
In this chapter, you've learned the basics of working with SpriteBuilder and Cocos2d,
how to create CCB files and nodes, how to edit their properties, and how to make code
connections. Specifically, you learned about the important Sub File node and how to use
it, and its benefits will become even more obvious in the coming chapters.
On the programming side, you learned how to change the start scene, how to create cus-
tom classes, how to react to button selectors, and how to load CCB files, and how to do
transitioning between scenes.
You now have a skeleton app with two scenes between which you can change back and
forth with a tap of a button. In the next chapter, you'll scroll the level to ensure the player
stays centered on the screen. And you'll add touch controls and movement to the player.
Search WWH ::




Custom Search