This is the final effect of the book, a complete Space war game:
Click to view Source code
There is not a lot of new knowledge, the things involved more is the game development optimization and skills, below we all look together:
Ship:
Similar particle effects in the particle creation method, our game ship also need the same creation mechanism to create, you can click to view the source code:
Gameactor
Gameactorpool
Additional explanation is the addition of a mechanism for collision detection, which writes the collision detection based on the spherical distance (simple and efficient) and the collision detection based on the Aabb box, but the collision detection of the AABB box is not used in the actual game.
Added a bit of optimization, that is, the physical object and camera distance to judge, if too far to render.
Level:
Still have to admire the author's ingenuity, the level is generally required an editor, the most incompetent will be manually filled with similar XML configuration files, and the author used two bitmaps as the level of data, one is a key bitmap, this bitmap is a 1xn rectangular picture, the first pixel represents the empty, The subsequent pixels and the incoming array in the program one by one correspond to a corresponding entity, can be a meteorite can also be an enemy and other physical objects;
Another image is our level picture, where each pixel can find the corresponding data in the key bitmap, indicating the position of an entity;
So the editing level becomes unusually simple, and of course the parse bitmap is not complicated;
Summarize:
At present Stage3D market is not very good, do not say the loss of the mobile side, page tour u3d strength also not to be underestimated, but can learn from the bottom is always good, another three-dimensional world is not only these technologies, and I think I just just get started, and then I will see some u3d aspects of things, Of course Stage3D will not put down like this, let ' s keep moving!
"Stage3D Study Notes" True 3D World (vi): Space war