Zapdoser – the tricky one

For the moment we have five kinds of different alien enemies, and one of our more special enemies is the so called “Zapdoser”. All aliens have a fixed path designed for them with their movement patterns. From their spawn positions it’s always from point A to B. With this kind of pattern, the player could be able to predict where the so called point B will be. After several playthroughs the player can sort of “pre shoot” with a certainty of how the alien will move. With this mechanic we’ve hopefully created a level of skill that can be improved from the player.

However, the one that stands out from this crowd of enemies is the Zapdoser. From the start it appears that the Zapdoser is slowly moving in a straight line towards the planet, but this is not the case. When the player shoots at the Zapdoser and the projectile is within a certain range of the Zapdoser, it quickly moves to the side. You could say that it dodges the bullet. With this movement the Zapdoser changes it’s movement pattern for everytime you try to shoot it. Here is an illustration of how it works:

zapdoserdemoreal.png

A is the first movement pattern (not to be confused with movement from point A to B). When the pullet reaches a certain radius of the Zapdoser, it goes sideways and dodges the bullet, movement B. To increasea the difficulty, I made movement B faster than A. After a short time it has now changed position and resumes to the A movement. I managed to do this by calculating the distance between the vectors of the two. When the length difference between the two vectors were 250 pixels, the Zapdoser took the B movement pattern for a second and then resumed to the original movement pattern. This was fairly simple, but I wanted it to be in relation with the player’s position. Since the turret is placed in the middle of the screen, the shots either go the the left or right. If the projectile was shot to the left side, I wanted the Zapdoser to move to the left and vice versa. It would’ve been quite a boring enemy if it always went to the same side. By checking if the mouse’s position was less or more than half of the screen width, it would go left is less than half and right if more than half.

Game testing this enemy I realized that it was a really tricky one. It kept dodging side to side. Having it’s spawn position kind of in the middle of the screen made for most fun and sometimes confusing mechanics. Depending of how fast my shooting rate was, it moved sporadically side to side. It was a bit difficult to kill at first, but with testing it more I came to the conclusion to just go mayhem on it, and to kill it fast, since it was much harder to kill it the closer to the planet it was. That is all from me this week.

About Matti Johansson

2015 Programming