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

Chapter 3. Tappy Defender – Taking Flight

We are now ready to quickly add a lot of new objects and some features as well. By the end of this chapter, we will be really close to a playable game. We will detect the player touching the screen, so he can control the spaceship. We will add virtual boosters to our SpaceShip class to move the ship up and down and increase the speed.

We will then detect the resolution of the Android device and use it to do things like prevent the player boosting off the screen, and to detect when our enemies need to respawn.

We will create a new EnemyShip class, which will represent the suicidal enemies. We will also see how we can easily spawn and then control them without changing any of the logic from the control part of our code.

We will add a scrolling effect by adding a SpaceDust class and spawning dozens of them to make it look like the player is whizzing through space.

Finally, we will learn about, and implement, collision detection so we know when our player has been hit by an enemy, as well as look at a graphical trick to help us with debugging our collision detection code.

主站蜘蛛池模板: 河曲县| 呼和浩特市| 綦江县| 樟树市| 东方市| 教育| 凉城县| 中牟县| 昂仁县| 工布江达县| 新闻| 广德县| 宜城市| 五华县| 宜城市| 晋中市| 衡水市| 通化县| 文化| 盐源县| 佛山市| 明光市| 永年县| 沧州市| 扶绥县| 建阳市| 白河县| 万州区| 柳林县| 韶山市| 沅陵县| 中阳县| 湘阴县| 赫章县| 迭部县| 抚松县| 青州市| 高唐县| 彝良县| 龙岩市| 年辖:市辖区|