Game Development Reference
In-Depth Information
Creating a Chain
You are probably eager to get going, so let's dive right in.
Right-click the
Prefabs
folder in SpriteBuilder's
File View
and select
New File
. Create a
document of type
Node
, and name it
Chain.ccb
. Now switch to the
Tileless Editor View
,
ensure the
GameElements
entry below the
Tileless Editor View
is selected, and confirm it
contains the images shown in
Figure 9-2
.
Figure 9-2
.
The chain and spring images
If the chain and spring images aren't there, you'll find them in the
GameElements
folder
of the
Graphics
archive. Drag and drop the PNG images whose names start with
chainball
and
springboard
into the
GameElements
Sprite Sheet in SpriteBuilder before proceeding.
Alternatively, use your own images. Just to give you a size reference, the chainball image
is 416x416 pixels and the springboard is 254x234 pixels, making these images much
smaller than the gear and saw.
Setting Up the Chain Sprites
Drag and drop two chainball chain images onto the
Chain.ccb
stage, one of each kind.
One looks like the lowercase letter l (
chainball_chain1.png
), and the other looks like an 8
(
chainball_chain2.png
). I will refer to them as simply the
letter I chain
and
letter 8 chain
images. They are the two rightmost images in the first row in
Figure 9-2
. Also, drag and
Search WWH ::
Custom Search