看博客学学Android(十四)

原文地址:

Day 12: Introducing DRONE INVADERS

I finally decided on the name. There were many game names out there, but I only found 6-7 available. This one seems to fit the game theme the best. New title screen is ready, using the same Ruslan font.

Drone Invader title

 

Today I learned difference between Comparable and Comparator in Java. I changed the bullet code, so that you can fire multiple bullets (laser fragments) at the same time. Also, you don't need to touch the alien to shoot it, but rather just fire in its direction and bullet hits it. Instead of going with full collision detection, I simply extrapolate bullet trajectory at the moment of firing and see which alien it hits first. This worked fine for all levels until the Boss level. Since Boss spits other aliens, he gets to be the first in array and bullet would fly through all the aliens and hit the boss. I left this behavior if you touch the boss directly. But, when you just shoot in some direction I'm sorting the aliens by y-coordinate to shoot the nearest one.

This new feature changes gameplay a bit. It's now easier to play, and more enjoyable as aliens you shoot are no longer obscured by your finger. The game has turned from "precise touches" to "shooting fest" and only that 10-bullet clip prevents you from destroying everything in two seconds.

I guess I'll now have to make alien movement even more challenging, so that the game doesn't get too easy.

Day 12: Part 2

Aliens hiding behind a moon

I started to like the game too much, and decided to work on it more before going to sleep. On levels 16, 26,... I added a big moon, and aliens are hiding behind it. The moon slowly moves across the screen, just in time to finish before the Boss level. This makes the gameplay really challenging. It was also challenging to do detection whether aliens are hidden behind the moon or not. Since moon is round, rectangles are not very easy to use. I looked into pixel-precise detection, but I'm afraid it would slow the game to look individual pixels each time a shot is fired - especially since moon is rotating all the time. So I just reduced the original sprite rectangle by some 12% and I'm doing the rectangular checks instead. It is not pixel-precise, but it works really well. The way it works, bullets fly over the moon and aliens fly under the moon, so you can shoot those who haven't reached the cover yet.

I'm really satisfied with the gameplay now. It's fun, challenging and engaging. Now I need more bosses, a couple of more alien types and powerups. Without powerups it's a real challenge to reach wave 60, so I'll try to create enough content to have new stuff show up at least until level 100 without repeating bosses. I guess it will be easier with powerups. We'll see once I add those.

This is the first time I'm feeling it's going to be a great game, rising above the average space shooter.

 

 

 

我终于决定了名字。有很多游戏的名字了,但我只找到了6-7可用。这一个似乎符合游戏主题的最好的。新的屏幕上的标题可以使用相同的字体,鲁斯兰。

今天我学会了在Java和比较器之间的差异比较。我改变了子弹的代码,这样你就可以火多子弹(激光碎片)在同一时间。另外,你不需要触摸拍摄外星人,而是火的方向和子弹击中它。而不是完整的碰撞检测,我简单的外推弹道在射击时,看到外星人击中第一。这工作得很好,直到老板级水平。因为老板吐其他外国人,他是在阵列和子弹首先将穿越所有的外星人打老板。我把这种行为如果你碰老板直接。但是,当你在拍摄一些方向我整理外星人的y坐标拍摄的最近的一个。

这个新功能改变游戏玩法。它现在更容易发挥,更愉快的外星人,你拍的不再是你的手指遮住。游戏开始了从“精确的接触”到“射击节”,只有10的子弹夹在两秒钟内阻止你摧毁一切。

我想我现在要让外来的运动更具挑战性,使游戏不太容易。

 

我开始喜欢这游戏太多了,并且决定在它睡觉前工作。在16级,26,…我添加了一个大的月亮,和外星人的躲在它的后面。月亮慢慢地在屏幕上移动,只是在时间之前完成老板的水平。这使得游戏真的很有挑战性的。这也是外星人是否隐藏在月球或不检测的挑战。因为月亮很圆,矩形,是不是很容易使用。我看着像素精确的检测,但我恐怕这将减缓比赛看各个像素的每一次射击-尤其是因为月亮旋转所有的时间。所以我只是减少原有精灵矩形有12%和我做检查,而不是矩形。它不是像素精确的,但它真的很好。它的工作方式,子弹飞过月亮和外星人飞下的月亮,所以你可以拍摄那些还没有达到盖呢。

我很满意现在的游戏。这是有趣的,富有挑战性和参与。现在我需要更多的老板,一对夫妇的外星人的类型和通电。没有通电,它达到60波的一个真正的挑战,所以我会尽力创造足够的内容有新的东西出现至少直到100级无重复的老板。我想它会更容易通电。我们会看到我曾经把这些。

这是我的感觉,这将是一个伟大的游戏的第一时间,高于平均的空间射击。

posted @ 2013-11-14 21:45  北漂梧桐  阅读(142)  评论(0编辑  收藏  举报