Game Development Reference
In-Depth Information
rently located inside your if(onScreen && launchIt) else statement (reference Figure
17-45 ) .
Since those alternating boolean values will now be subsequently replaced by the
.nextBoolean() method call in the if(!callAttack) structure, they can be safely re-
moved, because the if(!callAttack) conditional structure randomly sets these two
boolean values. The result of this is that now the iBeagle Enemy Actor object will ran-
domly appear from out of either side of the screen, and the game player cannot anticip-
ate where the attack is coming from anymore.
Use a Run Project work process, and play and test the game, which is seen in
Figure 17-55 . The first thing that you will notice is that all of our z-index character
layer ordering is correct. You will also see that your Enemy and Projectiles are not
visible at game start-up, which is another step toward a professional end-user experien-
ce.
Figure 17-55 . Use a Run
Project work process to test the game and the enemy attack, bullet types, and scoring
engine
You will notice that it is much more difficult to get the InvinciBagel into position,
as you do not know where, when, or what direction the enemy attack is going to come
from! Well, that is not entirely true, as we would need to randomize the attackFre-
quency variable to get the “when he appears” part to not be triggered at even time in-
tervals. Since our objective is to make this game progressively more and more challen-
ging and professional, let's do this next!
For the remainder of the chapter we will add some features that make the game
play more challenging and realistic. We will add some of the important game design
elements such as randomization, artificial intelligence, and physics simulation, all of
which will make your Java 8 games more professional and popular. You need to have
 
 
Search WWH ::




Custom Search