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

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.

主站蜘蛛池模板: 大竹县| 子洲县| 那曲县| 宁强县| 靖西县| 栖霞市| 新绛县| 称多县| 嘉兴市| 乌兰县| 琼结县| 宕昌县| 沙洋县| 塔城市| 大石桥市| 安龙县| 冀州市| 芦溪县| 彭山县| 呼图壁县| 夏邑县| 马山县| 水城县| 涞水县| 兰考县| 晴隆县| 府谷县| 布拖县| 丹寨县| 孟连| 梨树县| 芜湖县| 科技| 顺平县| 凯里市| 望城县| 苍南县| 牙克石市| 阿克苏市| 梅州市| 建宁县|