- Game Development Patterns and Best Practices
- John P. Doran Matt Casanova
- 367字
- 2021-07-02 23:43:41
Understanding the separation of concerns
Each of these different aspects is a problem of its own, and trying to solve all of these issues at once would be quite a headache. One of the most important concepts to learn as a developer is the idea of compartmentalizing problems, and breaking them apart into simpler and simpler pieces until they're all manageable. In computer science, there is a design principle known as the separation of concerns which deals with this issue. In this aspect, a concern would be something that will change the code of a program. Keeping this in mind, we would separate each of these concerns into their own distinct sections, with as little overlap in functionality as possible. Alternatively, we can make it so that each section solves a separate concern.
Now when we mention concerns, they are a distinct feature or a distinct section. Keeping that in mind, it can either be something as high level as an entire class or as low level as a function. By breaking apart these concerns into self-contained pieces that can work entirely on their own, we gain some distinct advantages. By separating each system and making it so they do not depend on each other, we can alter or extend any part of our project with minimal hassle. This concept creates the basis for almost every single design pattern that we'll be discussing.
By using this separation effectively, we can create code that is flexible, modular, and easy to understand. It'll also allow us to build the project in a much more iterative way because each class and function has its own clearly defined purpose. We won't have to worry nearly as much about adding new features that would break previously written code because the dependencies are on the existing functional classes, and never the other way around. This means we can to easily expand the game with things like Downloadable Content (DLC). This might include new game types, additional players, or new enemies with their own unique artificial intelligence. Finally, we can take things we've already written and decouple them from the engine so we can use them for future projects, saving time and development costs.
- scikit-learn Cookbook
- Node.js+Webpack開發(fā)實(shí)戰(zhàn)
- JavaScript+DHTML語法與范例詳解詞典
- C#編程入門指南(上下冊)
- Instant Typeahead.js
- JavaScript前端開發(fā)與實(shí)例教程(微課視頻版)
- Unity 2018 Shaders and Effects Cookbook
- Instant PHP Web Scraping
- Scala for Machine Learning(Second Edition)
- The Statistics and Calculus with Python Workshop
- Microsoft HoloLens By Example
- Java從入門到精通(視頻實(shí)戰(zhàn)版)
- 實(shí)驗(yàn)編程:PsychoPy從入門到精通
- 從零開始學(xué)Unity游戲開發(fā):場景+角色+腳本+交互+體驗(yàn)+效果+發(fā)布
- Unity 5 Game Optimization