O'Reilly logo

Programming Video Games for the Evil Genius by Ian Cinnamon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:
Image
<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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required