- 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.
- Developing Mobile Web ArcGIS Applications
- TestNG Beginner's Guide
- R語言編程指南
- Learn Swift by Building Applications
- Spring實戰(zhàn)(第5版)
- INSTANT Django 1.5 Application Development Starter
- C語言程序設計上機指導與習題解答(第2版)
- ServiceNow:Building Powerful Workflows
- 基于ARM Cortex-M4F內(nèi)核的MSP432 MCU開發(fā)實踐
- Learning Splunk Web Framework
- STM8實戰(zhàn)
- Java高手是怎樣煉成的:原理、方法與實踐
- C語言程序設計教程
- Learn Linux Quickly
- SAP HANA Starter