官术网_书友最值得收藏!

Chapter 2. Adding Interactivity – The Making of a Concentration Game

By definition, a game is interactive in some way. Players have to be part of it by doing things. The simplest form of interactivity is clicking or touching tiles in the game.

A Concentration game is simple to explain, but it will cover some new and important concepts, such as:

  • Creating multiple instances of game assets
  • Extending classes to improve its capabilities. Actually, there are no classes in JavaScript, but they are emulated using variables and prototypes
  • Adding gradients
  • Making assets react to clicks and touches
  • Changing sprite images on the fly
  • Adding text labels
  • Removing sprites from the game

By the end of the chapter, you will be able to create a full Concentration game using space for customization.

As the project created in the previous chapter is more than just a Hello World game and rather acts as a blueprint for all your future projects, you'll start building our Concentration game out of the previously finished project.

主站蜘蛛池模板: 宾阳县| 连城县| 连南| 普陀区| 大安市| 来凤县| 南通市| 澎湖县| 双流县| 土默特右旗| 吐鲁番市| 沂南县| 阿图什市| 乐至县| 太原市| 民县| 延吉市| 巴林右旗| 临沧市| 崇礼县| 汉川市| 独山县| 鄂尔多斯市| 兖州市| 县级市| 湘阴县| 思茅市| 鄯善县| 寻乌县| 宁明县| 吴忠市| 丹东市| 新干县| 惠来县| 弥勒县| 阳江市| 广丰县| 义乌市| 鄂尔多斯市| 巍山| 开化县|