This was my first Java program. I had specifically approached the language to code applets. This is the most stripped down top scrolling shooter ever, but it was a good experience learning Java code and syntax and it’s a lot of fun to play. Use the left and right arrow keys to navigate and the up arrow key or space bar to shoot. Shots will only destroy the circles, the squares you just have to dodge.
Category Archive: Java
Dodge Game
Missile Command
This Java applet is a clone of the classic arcade game Missile Command. My addition to the game is ability to upgrade the speed of your rockets, the size of the explosion, the size of your stockpile, or the speed that rockets are produced. You can also add shields to cities and factories. When all your cities are destroyed, you lose. As factories are destroyed, the rate that your rockets are produced drops. You must destroy ten incoming missiles to move to the next level. This was my first medium sized coding project in Java. The code was split across several classes and I was able to get a little bit of inheritance going on.
Animated Tiles Game
This Java game is like a jigsaw puzzle, only the sides are all flat, and the picture is animated. Press the Scramble tiles button then try to put the picture back together. This does not play well with IE and I highly recommend Firefox.
One piece of code that I’m very proud of in this applet is the moue listening structure. There is a tile class and a tile manager class. The tile manager acts as a mouse click listener. All tiles act as mouse movement listeners and contain no code themselves to discern if they should be tracking the mouse (being dragged). Instead when a mouse click is detected, the tile manager decides which tile was clicked, and registers it with the applet as a mouse listener, and when the mouse is released, it is unregistered.
Eco System
The following Java applet is a simulation of a bio-system. There are plants (green), herbivores (blue) and carnivores (red). Plants get energy from the sun (of which there is a limited amount), herbivores get energy from plants and carnivores get energy from herbivores. It’s a complex system, but the result is fun to watch. This program is based off of an earlier one I wrote in QBasic a long time ago. That program ran well, but it often developed cannibals because it was possible to eat one thing and produce two identical things. By basing everything off energy, the system is far more realistic.