官术网_书友最值得收藏!

Summary

In this chapter, we learned how to create a basic game framework. We learned what a game loop is and how we create one for WebAssembly using Emscripten. We learned about game objects and created classes to define our player's spaceship, an enemy spaceship, and projectiles. We learned about object pooling, and how we can use an object pool to recycle objects in memory so that we do not need to create and destroy new objects in memory continually. We used this knowledge to create an object pool for our projectiles. We also created an AI stub for our enemy spaceship that gave that object random behavior, and we created functions that let our player and enemy shoot at each other while our projectiles pass harmlessly through the spaceships. 

By the end of the next chapter, we will add collision detection; this will allow our projectiles to destroy the spaceships they hit, and add an animation sequence that will show a ship being destroyed when it is hit by one of the projectiles.

主站蜘蛛池模板: 涿州市| 溆浦县| 永年县| 兴和县| 辽源市| 阿瓦提县| 读书| 安福县| 思茅市| 新丰县| 缙云县| 云南省| 安国市| 宜宾县| 四平市| 青河县| 太康县| 冀州市| 上犹县| 茂名市| 小金县| 河津市| 凤冈县| 文登市| 保山市| 察隅县| 右玉县| 津市市| 共和县| 麻栗坡县| 宜昌市| 云林县| 施秉县| 斗六市| 峨眉山市| 色达县| 宝应县| 富顺县| 平度市| 武定县| 大庆市|