About the Author |
|
ix | |
About the Technical Reviewer |
|
xi | |
Acknowledgments |
|
xiii | |
|
Chapter 1 Getting Started |
|
|
1 | (4) |
|
|
1 | (2) |
|
|
3 | (1) |
|
|
3 | (2) |
|
Chapter 2 Using Tiled Editor |
|
|
5 | (30) |
|
|
6 | (1) |
|
|
7 | (2) |
|
Setting Images Properties |
|
|
9 | (1) |
|
|
10 | (3) |
|
|
13 | (3) |
|
Understanding the JSON Map Data |
|
|
16 | (5) |
|
Using JSON Data to Build the Level |
|
|
21 | (1) |
|
Deciding How to Use the Data |
|
|
21 | (1) |
|
|
22 | (1) |
|
Writing the makeTiledWorld Function |
|
|
22 | (6) |
|
|
28 | (2) |
|
|
28 | (1) |
|
Changing the Sprite's Depth Layer |
|
|
29 | (1) |
|
|
30 | (4) |
|
|
34 | (1) |
|
Chapter 3 Tile-Based Collision |
|
|
35 | (32) |
|
Understanding Tile-Based Collision |
|
|
36 | (1) |
|
|
37 | (14) |
|
|
38 | (1) |
|
Initializing the Game World |
|
|
39 | (1) |
|
Understanding the Bomb Map |
|
|
40 | (2) |
|
Moving the Alien in Alignment with the Grid |
|
|
42 | (2) |
|
Collisions with Moving Sprites |
|
|
44 | (2) |
|
Checking Collisions by Comparing Array Locations |
|
|
46 | (3) |
|
Giving the Bombs a Random Direction |
|
|
49 | (1) |
|
|
49 | (2) |
|
|
51 | (6) |
|
A Reusable Tile-Based Collision Function |
|
|
53 | (4) |
|
Using Inverse Collision Detection to Check for Obstacles |
|
|
57 | (3) |
|
Tile-Based Collision for Role Playing Games |
|
|
60 | (3) |
|
Defining the Collision Area |
|
|
60 | (3) |
|
Collisions with Obstacles |
|
|
63 | (3) |
|
|
64 | (2) |
|
|
66 | (1) |
|
|
67 | (34) |
|
|
68 | (7) |
|
Making a Cartesian Tile Map |
|
|
69 | (2) |
|
Making an Isometric Tile Map |
|
|
71 | (4) |
|
Working with Isometric Properties |
|
|
75 | (3) |
|
Moving Around an Isometric World |
|
|
78 | (3) |
|
Isometric Collision Detection |
|
|
81 | (2) |
|
|
83 | (5) |
|
Sorting a Sprite by Its z Property Value |
|
|
84 | (1) |
|
Layering 3D Isometric Sprites |
|
|
85 | (2) |
|
|
87 | (1) |
|
Making Isometric Maps with Tiled Editor |
|
|
88 | (12) |
|
Configuring and Building the Map |
|
|
88 | (3) |
|
The makelsoTiledWorld Function |
|
|
91 | (6) |
|
|
97 | (3) |
|
|
100 | (1) |
|
Chapter 5 Pathfinding Basics |
|
|
101 | (30) |
|
Random Movement Through a Maze |
|
|
102 | (10) |
|
|
102 | (1) |
|
Moving the Sprite in the Game Loop |
|
|
102 | (1) |
|
Is the Sprite Centered Over a Tile Cell? |
|
|
103 | (1) |
|
Finding the Valid Directions |
|
|
104 | (8) |
|
|
112 | (5) |
|
|
113 | (2) |
|
Finding the Closest Direction |
|
|
115 | (2) |
|
|
117 | (7) |
|
|
118 | (1) |
|
Finding the Positions of the Collision Points |
|
|
119 | (2) |
|
Testing the Points for Collisions with Obstacles |
|
|
121 | (1) |
|
|
122 | (2) |
|
|
124 | (5) |
|
|
125 | (1) |
|
|
126 | (1) |
|
The tileBasedLineOfSight Function |
|
|
126 | (3) |
|
|
129 | (2) |
|
Chapter 6 Finding the Shortest Path |
|
|
131 | (32) |
|
|
132 | (10) |
|
|
133 | (2) |
|
|
135 | (6) |
|
Linking the Nodes Through Their Parents |
|
|
141 | (1) |
|
|
142 | (10) |
|
|
142 | (1) |
|
The shortestPath Function |
|
|
143 | (7) |
|
Using the shortestPath Function |
|
|
150 | (2) |
|
|
152 | (3) |
|
|
155 | (1) |
|
|
156 | (3) |
|
Extending and Customizing A* |
|
|
159 | (2) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
160 | (1) |
|
|
161 | (2) |
|
Chapter 7 More Fun with Tile-Based Games |
|
|
163 | (20) |
|
Using Extra Game Data for Al Systems |
|
|
163 | (11) |
|
Storing Hidden Game Data in Arrays |
|
|
169 | (1) |
|
Adding an Al Controlled Car |
|
|
169 | (5) |
|
Broadphase and Narrowphase Collision |
|
|
174 | (8) |
|
|
175 | (2) |
|
Implementing a Spatial Grid |
|
|
177 | (1) |
|
|
177 | (4) |
|
Other Broadphase Collision Strategies |
|
|
181 | (1) |
|
|
182 | (1) |
Index |
|
183 | |