- Game Development Patterns and Best Practices
- John P. Doran Matt Casanova
- 239字
- 2021-07-02 23:43:47
Creating Flexibility with the Component Object Model
In the last chapter, we saw how the Singleton pattern can help us solve the problem of creating and using the big core engines of our game. The engine code is designed to work with any game, meaning there is nothing gameplay-specific about it. So as the game design evolves, we don't need to worry about changes in game design breaking our engine. The goal when writing code for a graphics or physics engine is to make it as reusable or game-agnostic as possible. This means that when you are done making the current game, you should be able to use the code in the next game with very little or no change. The way to do this is to separate the engine code from anything related to the specific game.
Game objects, on the other hand, are completely specific to our game. If the game changes, all our object types will need to change as well. If we are making a platformer and suddenly change to making a Space Shooter, our graphics and physics engine code probably doesn't need to change. However, every single game object and behavior will change. While this may be the most extreme example, the fact is that our game objects are likely to change a lot. So let's look at how we can use patterns to solve this small, but very important, piece of our game.
- 精通JavaScript+jQuery:100%動(dòng)態(tài)網(wǎng)頁(yè)設(shè)計(jì)密碼
- Mastering Adobe Captivate 2017(Fourth Edition)
- 企業(yè)級(jí)Java EE架構(gòu)設(shè)計(jì)精深實(shí)踐
- Getting Started with ResearchKit
- Interactive Data Visualization with Python
- Python貝葉斯分析(第2版)
- Mastering Android Game Development
- Multithreading in C# 5.0 Cookbook
- 小程序,巧應(yīng)用:微信小程序開(kāi)發(fā)實(shí)戰(zhàn)(第2版)
- C#面向?qū)ο蟪绦蛟O(shè)計(jì)(第2版)
- Web前端開(kāi)發(fā)技術(shù):HTML、CSS、JavaScript
- Hadoop Blueprints
- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- 生成藝術(shù):Processing視覺(jué)創(chuàng)意入門(mén)
- Expert Cube Development with SSAS Multidimensional Models