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

Chapter overview

In this chapter, we will be focusing on creating a game object that is flexible enough to adapt as our game design changes. We will do this by first looking at the two most common ways that new programmers create a game object, and the problems that arise when we use these approaches. Then we will discuss two design patterns that can help us solve our problem. Finally, we will arrive at our solution of creating a reusable, flexible game object. Since we know our game design and game objects are likely to change, the questions we are going to answer are the following:

  • Is it possible to write game objects in a reusable way?
  • How can we decouple our game objects from our core engine code?
  • If we have a reusable game object, how can we make it flexible enough to use in different games or account for changes in our game design while the game is being developed?

Along the way, we will discuss a few important design principles that will come up again and again in this book that will help you write clean and solid code.

主站蜘蛛池模板: 历史| 曲阜市| 汝南县| 海口市| 绥中县| 兴海县| 福州市| 龙岩市| 衡东县| 青川县| 格尔木市| 郴州市| 齐齐哈尔市| 敦煌市| 大姚县| 垫江县| 平定县| 庆阳市| 修武县| 鄯善县| 平武县| 抚远县| 息烽县| 玉林市| 桑植县| 安国市| 安陆市| 靖边县| 华容县| 钟山县| 万载县| 修水县| 兴国县| 乾安县| 晋城| 汨罗市| 根河市| 宽城| 周口市| 克什克腾旗| 五华县|