Table of Contents

Foreword xi

Preface xiii

Acknowledgments xxi

About the Authors xxiii

 

Part I: Introduction to Alice 1

 

1 Getting Started with Alice 3

1-1 Introduction to Alice 3

1-2 Alice Concepts 8

  Tips & Techniques 1: Special Effects: Text and 2D Graphic Images 15

  Summary 18

  Exercises 19

2 Program Design and Implementation 22

2-1 Scenarios and Storyboards 22

2-2 A First Program 29

  Tips & Techniques 2: Orientation and Movement Instructions 43

  Summary 57

  Exercises 59

3 Programming: Putting Together the Pieces 62

3-1 Built-in Functions and Expressions 63

3-2 Simple Control Structures 68

  Tips & Techniques 3: Camera and Animation Controls 76

  Summary 81

  Exercises 83

 

Part II: Object-Oriented and Event-Driven Programming

Concepts 87

 

4 Classes, Objects, Methods and Parameters 89

4-1 World-Level Methods 91

4-2 Parameters 100

4-3 Object-Level Methods and Inheritance 110

  Tips & Techniques 4: Visible and Invisible Objects 121

  Summary 127

  Exercises and Projects 129

5 Interaction: Events and Event Handling 140

5-1 Interactive Programming 140

5-2 Parameters and Event Handling Methods 147

  Tips & Techniques 5: Creating Your Own People Models 156

  Summary 158

  Exercises and Projects 159

 

Part III: Using Functions and Control Statements 171

 

6 Functions and If/Else 173

6-1 Functions 173

6-2 Execution Control with If/Else and Boolean Functions 180

  Tips & Techniques 6: Random Numbers and Random Motion 196

  Summary 199

  Exercises and Projects 201

7 Repetition: Definite and Conditional Loops 213

7-1 Loops 213

7-2 While—a Conditional Loop 219

  Tips & Techniques 7: Events and Repetition 225

  Summary 228

  Exercises and Projects 229

8 Repetition: Recursion 239

8-1 Introduction to Recursion 239

8-2 Another Flavor of Recursion 244

  Tips & Techniques 8: Engineering Look and Feel 254

  Summary 257

  Exercises and Projects 258

 

Part IV: Advanced Topics 265

 

9 Lists and List Processing 267

9-1 Lists 267

9-2 List Search 273

  Tips & Techniques 9: Groups 277

  Summary 279

  Exercises and Projects 280

10 Variables and Revisiting Inheritance 289

10-1 Variables 289

10-2 An Array Visualization Using an Index Variable 300

  Tips & Techniques 10: Debugging with Watch and Text Output 308

  Summary 312

  Exercises and Projects 313

11 What’s Next? 322

11-1 Transition to Java 322

11-2 Alice 3 327

  Tips & Techniques 11: Poses 328

 

Appendix A: Using Alice 331

Part 1: Running Virtual Worlds in Alice 331

Part 2: Using Popup Menus to Create an Initial Scene 345

Appendix B: Managing the Alice Interface 350

 

Index 363