Book Image

Learning Dart

Book Image

Learning Dart

Overview of this book

Table of Contents (19 chapters)
Learning Dart
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Building Games with HTML5 and Dart

In this chapter, you will use the knowledge of the previous chapters to create a well-known memory game. But instead of presenting and explaining the code completed in the previous chapters, a model is designed first, and you work up your way from a modest beginning to a completely functional game, spiral by spiral. You will also learn how to enhance the attractiveness of web games with audio and video techniques. The following topics will be covered in this chapter:

  • The model for the memory game

  • Spiral 1 – drawing the board

  • Spiral 2 – drawing cells

  • Spiral 3 – coloring the cells

  • Spiral 4 – implementing the rules

  • Spiral 5 – game logic (bringing in the time element)

  • Spiral 6 – some finishing touches

  • Spiral 7 – using images

  • Adding audio to a web page

  • Using an audio library – Collision clones

  • Adding video to a web page