Section Four
Shoot ‘em up Games
Project 26: Snake Pit—The Arena
Snake Pit
Two snakes. One mouse. Venom flying everywhere! Snake Pit is a classic “shoot ‘em up” game in which you must prevent your opponent from capturing prey as you avoid being hit by his/her poisonous venom.
Project
Create the snake pit.
New building blocks
Component Color, JLabel Font
Component color
When using a Container, you can easily set the color of the background of any component, such as a JFrame, by using the command:
<color>
can be any you choose. The option to select a color pops up after you type the period. Figure 26-1 illustrates a new background color. ...Get Programming Video Games for the Evil Genius now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.