Hi all,
Thank you all for support so far on this journey. Obviously I have more questions.
After playing the original 1942 via emulation online, I realized one of the features that made the game so exciting was the somewhat unpredictable movement of the enemy aircraft. They turn and flying in wave like patterns, and often spawn in groups. And sometimes they fire projectiles that don’t move straight down toward the bottom of the screen.
How best to implement such things?
To fake the turning I could add some extra images to the enemy plane sprite, essentially one set of sprites for each of the 45 degree increments, or perhaps even 22.5 degree increments. Changes in X and Y would then be calculated via some trig and normalized to avoid errors with speed. Or I could use the ‘euler’ option and allow even quite small changes in heading. Change of position should be identical or very similar to the manual method.
Non-downward heading bullets are presumably being fired at the player’s aircraft. So grab the player’s position, calculate an angle to travel. If the Player is still there when the bullet arrives then it is kaboom time. If not, well the bullet will continue off to exit the screen (though not necessarily at the bottom like they do now.
Making planes follow a pattern seems like a bit more of challenge. The patterns followed appear to be either a straight forward modification of the X and Y once per frame. So the plane is changing position by say: -1 to X and -1 to Y, or +1 to X. Should be simple enough to implement (famous last words?).
More complicated are the waves of enemy fighters that seem to be following a half a sine wave. They appear near the top of the screen (sometimes on the left and right extremes and not at the top). They move in a curved pattern down what appears to be a sine wave and after reaching the bottom climb up a sign to offscreen.
Of cause with all this moving around going on a new problem does arise. Do enemy aircraft destroy themselves by colliding with other enemy aircraft, and if so does the player score from such collisions? With bullets now flying off in all sorts of directions there is the possibility of friendly fire between enemy aircraft. I have not been able to actually see how 1942 handles this.
As always, any input or direction would be welcome.
Regards
Frank