2006

xiaoxiao2021-04-07  261

The goal of the next completion: players can walk on the map and have collision detection. Target queue: 1. Play can walk on the map and have collision detection. 2. Read the file map data 3. Implement bomb 4. Realize prizes

• Some of the recent completion (*) representatives recently completed X representatives not doing

Game System: Program Manager (*) || - Library Initialization (*) || - Application Windows Message Response (*) | | Producer Game World (*)

Game World (CGAMEWORLD)? || --- Game Object ID Manager (*) || ---- Game Map (*) || - Special Collection Auxiliary List X || ---- Game Main Cycle (*)

Resource Manager (?) || --- Elf Resource Management (Animation Management) (*) || --- Image Management (X) || --- Sound Management (X)

Enter Device Management (*) | - Enter the device interface (convert all input signals to "up and down left and right ab" control information. (*)

Related Support System || - Custom RTTI (*)

Major Game Relation :: CGAMEOBJECT (?) |

| --CGAMEWORLD (?) || --cmover (?) | || | --cbomb (x) | || | --cmounster (x) || --cPrize (X) || --cfire (x) || --ccollision (*) | || | --cbox (*) | || | --cstone (*) || --cdiemoive (*)

Game class brief description: CGAMEObject: Provide the basic interface of the game object, such as object activation, object binary (serialization), obnession, etc. CGAMEWORLD: Generate a game object, have a map, can traverse all game objects CBMB: Bomb in the game, Also have obstacles. CPlayer: Players in the game CPRIZE: Monsters in the game CPRIZE: Game prizes CBOX, CStone: The collisions in the game are: Box can be crimped and may wear wall, how Cstone stone will change, However, it must be a barrier. CDIEMOIVE: Death animation, its object will not work with the game object, which will be generated after the character or monster is dead.

Collision detection in the game: Let's talk about the general collision rules after the update: 1> All collisions cannot overlap 2> The moveer stops moving immediately before the collision is generated.

Let's take a look at the lattice in the latest game map: struct item {struct {soft; // There is a wall that can be penetrated by the penetration function; // can not penetrate} coll;

Bomb; // Bomb id Fire; // Flame ID}; map data is similar to this GameMap [coly] [colx]; several best occurred in these squares in the event, when I want to detect the front? Collision, you can remove data directly. This is the fastest way.

Regarding the movement of the bomb, the implementation of the mobile function of the box: In fact, these are not current goals, but it also gives the relevant implementation method ideas. These two objects are actually detecting collisions (moving objects), itself has collisions of. For this object in movement, we can first extract the relevant data in the map and add its own ID to a special collision queue, and the ties detection in the special collision queue are precise detection.

In fact, the two collision detection methods are used at the same time. When using arrays, it is the fastest, and it is the most accurate.

转载请注明原文地址:https://www.9cbs.com/read-132632.html

New Post(0)